{"id":13999521,"date":"2021-02-03T22:09:04","date_gmt":"2021-02-03T22:09:04","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=13999521"},"modified":"2021-02-03T22:20:13","modified_gmt":"2021-02-03T22:20:13","slug":"error-in-javascript-includes-fix","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/error-in-javascript-includes-fix\/","title":{"rendered":"Error in Javascript; Includes Fix"},"content":{"rendered":"<p>The footer.php in the root directory has a script tag in it.  That script tag makes a common issue.  They use $ to represent jquery.  This is not acceptable (as is) in wordpress, as wordpress doesn&#8217;t define this by default.  The $ has to change to a &#8216;jquery&#8217; or you need to pass it as a param in a function.<\/p>\n<pre><code>\t\t\t&lt;script type=&#039;text\/javascript&#039;&gt;\n\t\t\tjquery.ajax({\n\t\t\t\t\t\t\turl: dsidxAjaxHandler.ajaxurl,\n\t\t\t\t\t\t\ttype: &#039;post&#039;,\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t&#039;action&#039;:&#039;dsidx_client_assist&#039;,\n\t\t\t\t\t\t\t\t&#039;dsidx_action&#039;: &#039;LoadDisclaimerAsync&#039;,\n\t\t\t\t\t\t\t\t&#039;params&#039;: &#039;{$paramsToJS}&#039;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t},\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsuccess: function(response){\n\t\t\t\t\t\t\t\tjquery(&#039;#{$disclaimerPlaceholderID}&#039;).replaceWith(response);\t\t\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\terror: function(response){\n\t\t\t\t\t\t\t\t\tjquery(&#039;#{$disclaimerPlaceholderID}&#039;).replaceWith(response);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t&lt;\/script&gt;\t\t<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-13999521","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13999521","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":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13999521\/revisions"}],"predecessor-version":[{"id":13999553,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13999521\/revisions\/13999553"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13999521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}