0

i enqueue js file in worpress and file is loaded and working with native js code but jQuery ready not working

 alert('working');  
jQuery(document).ready(function(){  
   alert('not working');  
});  

the site url
http://typingbooster.expotech.co.in/
please view source the file custom.js

4
  • 2
    any error in your browser console Commented Mar 22, 2015 at 10:46
  • no, the alert box is appearing (the working one), but the alert box (not working) one not executing, i am getting confuse why,, anything within ready function not executing,, Commented Mar 22, 2015 at 16:00
  • Is Jquery included before your script? Commented Mar 23, 2015 at 9:26
  • Is this fixed ?? Its common etiquette here at SOF to post back the status of the issue and accept/upvote answers if they helped you. Commented Mar 25, 2015 at 8:49

3 Answers 3

1

In wordPress environment, use this:

jQuery(document).ready(function($){

});
Sign up to request clarification or add additional context in comments.

Comments

0

Are you sure that jQuery has been enqueue'd? You can ensure it is by adding it to your functions.php:

add_action('init', 'load_jquery_scripts', 0);
function load_jquery_scripts() {
	wp_enqueue_script('jquery');
}

Comments

0
window.addEventListener("load", function(){
    alert('works');
});

Hope this will work for you!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.