I am using wordpress
for my site, and its running file on all browsers expect FireFox
.
In firefox
my site load half without styles and js
files, just html version with these errors in console.
ReferenceError: jQuery is not defined www.domain.com:591
ReferenceError: jQuery is not defined www.domain.com:853
ReferenceError: jQuery is not defined www.domain.com:1262
ReferenceError: jQuery is not defined www.domain.com:1443
ReferenceError: jQuery is not defined www.domain.com:1665
ReferenceError: $ is not defined www.domain.com:1786
ReferenceError: $ is not defined www.domain.com:1795
ReferenceError: $ is not defined
But I included jQuery
in my head:
<script src="/jquery-1.10.1.min.js"></script>
<script src="/jquery-ui-1.10.3.custom.js"></script>
But still its not working in firefox.
Any idea why its behaving like this in firefox?
You shouldn’t be adding scripts to your head. Use wp_enqueue_script instead http://codex.wordpress.org/Function_Reference/wp_enqueue_script
In the example below I load jQuery and jQuery UI core. Loading jQuery UI core will load jQuery anyway but it’s a good practise to specify it first.
There are more jQuery UI components so choose which you need from here:
http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_Scripts_Included_and_Registered_by_WordPress
You need to follow different way to enqueue JS in WordPress
step 1 – While enqueue script you have 2 kind of action-
a)’wp_enqueue_scripts’ – this action will be use if you want to enqueue scripts on the front end.
example-
b) ‘admin_enqueue_scripts’ – this action will be use if you want to enqueue scripts on admin pages.
step 2- After use particular action your script will be enqueue.
To know more please check following link-
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts