{"id":5638253,"date":"2015-01-05T19:24:10","date_gmt":"2015-01-05T19:24:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/enqueue-scripts-not-working\/"},"modified":"2016-08-22T15:05:47","modified_gmt":"2016-08-22T15:05:47","slug":"enqueue-scripts-not-working","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/enqueue-scripts-not-working\/","title":{"rendered":"Enqueue scripts not working"},"content":{"rendered":"<p>For awhile, I&#8217;ve been loading my scripts through the header.php file. I wanted to get with WordPress conventions and load all my scripts through the functions.php file instead.<\/p>\n<p>So I moved everything over to my functions.php file. I registered and enqueued a few styles and they work fine. I did the same with a few custom scripts and none of them work. They all work when placed back into the header.php file.<\/p>\n<p>It looks like the .js file is being loaded, but it throws up an error:<\/p>\n<blockquote>\n<p>Uncaught TypeError: undefined is not a function<\/p>\n<\/blockquote>\n<p>That points to the 11th line of that specific JS file which has this in it:<\/p>\n<p><code>jQuery(&#039;#desk1&#039;).powerTip({ manual: true });<\/code><\/p>\n<p>Each of these JS files starts with:<br \/>\n<code>jQuery(document).ready(function(){<\/code><\/p>\n<p>I looked and jquery.js is only being loaded once. Judging by the console, jQuery is loaded first before any of the other javascript files.<\/p>\n<p>As I mentioned earlier, these scripts all work just fine on the test site while they are called from the header.php file. Once I moved them into the functions.php file, they stopped working. Any help would be greatly appreciated!<\/p>\n","protected":false},"template":"","class_list":["post-5638253","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5638253","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\/5638253\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5638253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}