{"id":2048024,"date":"2011-04-24T11:01:43","date_gmt":"2011-04-24T11:01:43","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-wordpresscom-stats-javascript-error-in-internet-explorer\/"},"modified":"2016-08-19T23:45:22","modified_gmt":"2016-08-19T23:45:22","slug":"plugin-wordpresscom-stats-javascript-error-in-internet-explorer","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-wordpresscom-stats-javascript-error-in-internet-explorer\/","title":{"rendered":"[Plugin: WordPress.com Stats] JavaScript error in Internet Explorer"},"content":{"rendered":"<p>Internet Explorer gives the following JavaScript error with this plugin activated: &#8220;&#8216;undefined&#8217; is empty or not an object&#8221; I think the problem is here:<\/p>\n<p>if ( typeof addLoadEvent != &#8216;undefined&#8217; ) {addLoadEvent(load_cmc);}<br \/>\nelse {load_cmc();}<\/p>\n<p>I&#8217;m thinking of changing it into:<\/p>\n<p>if ( !addLoadEvent ) {addLoadEvent(load_cmc);}<br \/>\nelse {load_cmc();}<\/p>\n<p>Or perhaps:<\/p>\n<p>if ( typeof load_cmc != &#8216;undefined&#8217; ) {addLoadEvent(load_cmc);}<br \/>\nelse {load_cmc();}<\/p>\n<p>What would be the best method to get rid of the error without affecting how the scripts works? Perhaps there&#8217;s a better solution than the ones I suggested?<\/p>\n<p>https:\/\/wordpress.org\/extend\/plugins\/stats\/<\/p>\n","protected":false},"template":"","class_list":["post-2048024","topic","type-topic","status-closed","hentry","topic-tag-stats"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2048024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2048024\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2048024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}