{"id":449,"date":"2022-08-30T15:01:32","date_gmt":"2022-08-30T15:01:32","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/jquery-script-only-working-under-ie8-9-developer-tools-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:01:32","modified_gmt":"2022-08-30T15:01:32","slug":"jquery-script-only-working-under-ie8-9-developer-tools-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jquery-script-only-working-under-ie8-9-developer-tools-collection-of-common-programming-errors\/","title":{"rendered":"jQuery script only working under ie8\/9 developer tools-Collection of common programming errors"},"content":{"rendered":"<li>\n<p>The error is (in <code>slider.js<\/code>):<\/p>\n<pre><code>'console' is undefined\n<\/code><\/pre>\n<p>The <code>console<\/code> object is only defined in IE when you open the Developer Tools. Then, there&#8217;s no longer a JavaScript error and everything works.<\/p>\n<p>To fix the problem, you can either remove\/comment out the <code>console.log<\/code> call, or add something like this as your very first block of JavaScript:<\/p>\n<pre><code>\/\/ make it safe to use console.log always\n(function(b){function c(){}for(var d=\"assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info, log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn\".split(\",\"),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});\n<\/code><\/pre>\n<p>(snippet taken from http:\/\/html5boilerplate.com\/)<\/p>\n<\/li>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:43:22. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>The error is (in slider.js): &#8216;console&#8217; is undefined The console object is only defined in IE when you open the Developer Tools. Then, there&#8217;s no longer a JavaScript error and everything works. To fix the problem, you can either remove\/comment out the console.log call, or add something like this as your very first block of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-449","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=449"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}