{"id":424,"date":"2022-08-30T15:01:07","date_gmt":"2022-08-30T15:01:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/ie9-javascript-error-undefined-null-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:01:07","modified_gmt":"2022-08-30T15:01:07","slug":"ie9-javascript-error-undefined-null-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/ie9-javascript-error-undefined-null-collection-of-common-programming-errors\/","title":{"rendered":"IE9 Javascript Error :: Undefined\/Null-Collection of common programming errors"},"content":{"rendered":"<p>I have a piece of JS (below) that in IE9 is giving me the following error:<br \/>\n<strong><em>The value of the property &#8216;$&#8217; is null or undefined, not a Function object<\/em><\/strong><\/p>\n<p>In FFX, Chrome, and Safari I get no issues. Not sure whats going on here &#8211; still learning a bit, so be easy on me if it&#8217;s obvious \ud83d\ude42<\/p>\n<p>Thanks in advance!<\/p>\n<pre><code> \n    \n    \n    \n        function LA_triggerOverlay() {\n            $(\"#la-w-001-overlay\").toggle();\n        };\n       $(function () {\n           $(\"#sample-widget\").show();\n       });\n   \n   \n       \n   \n<\/code><\/pre>\n<ol>\n<li>\n<p>In latest versions of chrome and FF [and maybe Safari as well] &#8216;$&#8217; is natively supported as a synonym for document.getElementById()<\/p>\n<p>IE 9 does not support this natively, hence you get the error you stated.<\/p>\n<p>However, as gentleman above points out, you maybe missing a library [most likely jQuery]. I would highly suggest to include jQuery in your page and try the code again.<\/p>\n<p>You can reference jQuery easily via this snippet:<\/p>\n<pre><code>\n<\/code><\/pre>\n<p>So if this is the missing piece, it should solve your problem.<\/p>\n<\/li>\n<li>\n<p>Presumably you haven&#8217;t included a script <em>above<\/em> that code that defines the <code>$<\/code> symbol (e.g., jQuery or similar). There is no default <code>$<\/code> symbol, it&#8217;s just a symbol that&#8217;s used by a couple of popular libraries (jQuery, Prototype, and MooTools primarily). Unless you include one of those with a <code>script<\/code> tag above your code, you&#8217;ll get this error\u00a0\u2014 in any browser.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:26:14. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have a piece of JS (below) that in IE9 is giving me the following error: The value of the property &#8216;$&#8217; is null or undefined, not a Function object In FFX, Chrome, and Safari I get no issues. Not sure whats going on here &#8211; still learning a bit, so be easy on me [&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-424","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/424","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=424"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}