{"id":466,"date":"2023-05-22T09:00:00","date_gmt":"2023-05-22T09:00:00","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=466"},"modified":"2023-05-21T15:39:09","modified_gmt":"2023-05-21T15:39:09","slug":"error-message-is-not-defined","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/error-message-is-not-defined\/","title":{"rendered":"error message &#8220;$ is not defined&#8221;"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"166\" src=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/05\/image-18.png\" alt=\"\" class=\"wp-image-467\" srcset=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/05\/image-18.png 726w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2023\/05\/image-18-300x69.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/figure>\n\n\n\n<p>Check the jQuery version: Ensure that you are using a compatible version of jQuery. In your case, you are referencing jQuery 1.3.2. Consider upgrading to a newer version as jQuery 1.3.2 is quite old and may have compatibility issues with modern browsers.<\/p>\n\n\n\n<p>Double-check the path to the jQuery file to ensure it is correct. Verify that the file exists at the specified location and that the path is relative to your site&#8217;s root directory. Or Verify the order of script references: Make sure that the jQuery library is included before your custom script that uses jQuery. The order should be<\/p>\n\n\n\n<p>Check for conflicts with other libraries: If you have other JavaScript libraries included on your page, there might be a conflict with the <code>$<\/code> symbol. To avoid conflicts, you can use the <code>noConflict()<\/code> method. Here&#8217;s an example:<\/p>\n\n\n\n<script src=\"<%=ResolveUrl(\"~\/Scripts\/jquery-1.3.2.js\")%>\" type=\"text\/javascript\"><\/script>\n<script type=\"text\/javascript\">\n    var jQuery = $.noConflict(); \/\/ Use \"jQuery\" instead of \"$\" for jQuery code\n\n    jQuery(function() {\n        jQuery('#post').click(function() {\n            alert(\"test\"); \n        });\n    });\n<\/script>\n\n\n\n\n<p>Clear browser cache: Sometimes, the browser cache can cause issues with loading the updated JavaScript files. Clear the cache and try again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check the jQuery version: Ensure that you are using a compatible version of jQuery. In your case, you are referencing jQuery 1.3.2. Consider upgrading to a newer&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[188,187,186],"class_list":["post-466","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-compatibility-issues","tag-jquery-version","tag-not-defined"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"predecessor-version":[{"id":468,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions\/468"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}