Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I had two instances of jquery in my code and everything used to work. I decided to get rid of wordpress stock jquery by deregistering it through functions.php file. But now not a single jquery animation/script I've works!

I've jquery hardcoded in my header though:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>

You can check my problem here: http://dev.holiday.ge/

what is going on? please help me :)

share|improve this question
5  
What happens if you use the WordPress jQuery – as you should? –  toscho Oct 2 '12 at 12:02
1  
+1 just use the WordPress jQuery –  Chris_O Oct 2 '12 at 14:29
    
@toscho same thing happens, only when I've both wordpress jquery and my own scripts work. if I use only mine or only wordpress one scripts stop working! –  Sandro Dzneladze Oct 2 '12 at 15:33
    
@Chris_O read my comment above. –  Sandro Dzneladze Oct 2 '12 at 15:34
add comment

2 Answers

up vote 2 down vote accepted

Include jQuery the correct way with Function Reference/wp enqueue script « WordPress Codex; that method includes jQuery in "no conflict" mode with toher libraries and other javascript http://docs.jquery.com/Using_jQuery_with_Other_Libraries , and if you use Dev tools or Firebug, you will find two JS errors

TypeError: 'undefined' is not a function (evaluating '$(".prefooterslides")') settings.js:7 TypeError: 'undefined' is not a function (evaluating '$('.ac_results ul')') settings.js:85

which are a result of jQuery variable conflicts.

share|improve this answer
add comment

If you're stuck on using a Google hosted version of jQuery, there are two plugins that come to mind:

But as @songdogtech eluded to and @toscho mentioned, it's better to just use the core if you're not 100% comfortable with JavaScript debugging (if anything pops up as it did) and do not control the environment completely.

share|improve this answer
1  
He's not stuck with using ajax.googleapis.com; it's his choice. And those plugins include ajax.googleapis.com in no conflict mode, which is the issue here and the cause of the errors. –  songdogtech Oct 2 '12 at 13:16
    
Gotcha - thanks for pointing out. –  Zach Oct 2 '12 at 13:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.