1

If I enqueue jquery from my own server everything works fine and dandy:

add_action('init', 'headsetup');

function headsetup(){
wp_enqueue_script('jquery_script',get_template_directory_uri().'/js/jquery-.8.3.min.js');
}

but if I use the built in wordpress jquery everything falls over:

add_action('init', 'headsetup');

function headsetup(){
wp_enqueue_script('jquery');
}

Jquery is loading, I can see it in the site <head> but it's not triggering which means the scripts that follow don't work.

Any suggestion?

6
  • if your in firefox, press CTRL + SHIFT + K, it will tell you if jquery has loaded, then go from there Commented Mar 23, 2013 at 21:37
  • Where are you trying to enqueue jquery? Commented Mar 23, 2013 at 21:38
  • @Edgar: In functions.php. It works perfectly if I enqueue from my server but if I use the built in wordpress jquery it doesn't. The enqueue is in exactly the same place in functions.php Commented Mar 23, 2013 at 21:40
  • I mean where are you trying to use the jquery? In your admin pages? On all of your pages? Commented Mar 23, 2013 at 21:41
  • @Connor: no js errors reported Commented Mar 23, 2013 at 21:42

1 Answer 1

1

Sorted!

All I had to do was change the way I called jquery.

Instead of:

$("somefunction")

It has to be:

jQuery("somefunction")

It's a wordpress thing...

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

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.