2952 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Elite Author
  • Exclusive Author
+5 more
DDStudios says

Hey guys , I’m helping a client with a theme and when I add google map on the contact page , the menu and cufon stop working : http://cancergenetics.com.s93712.gridserver.com/?page_id=262

I have no idea how to fix these javascript bugs.

Thanks for the help!

629 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • United States
VagrantRadio says

Looks like you’re using jQuery and Prototype libraries and not using jQuery.noConflict() in your menu script.

Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery’s case, $ is just an alias for jQuery, so all functionality is available without using $. If we need to use another JavaScript library alongside jQuery, we can return control of $ back to the other library with a call to $.noConflict():

http://api.jquery.com/jQuery.noConflict/

This is the errror I get in Firebug.

$(”#menu ul a”) is null [Break on this error] $(”#menu ul a”).removeAttr(‘title’);

2952 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Elite Author
  • Exclusive Author
+5 more
DDStudios says

Ok .. so what do I do now ?

Sorry I havent code that theme and I dont have any knowledge about javascript :)

715 posts
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Belgium
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
Hy-Studio says

I’m not a javascript expert, but I think that you can please this in the header:

<script type="text/javascript"> $.noConflict(); // Code that uses other library's $ can follow here. </script>

Since your using 2 different types of javascript libraries your having some functions conflicts.

1173 posts
  • Australia
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
Motionreactor says

Don’t you just love it that JS doesn’t have namespaces?

Here’s a project looking to solve that: http://code.google.com/p/namespacedotjs/

437 posts Don't be a HATER!
  • Exclusive Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 4-5 years
webinpixels says

The site call jQuery twice..some plugin call jQuery ver. 1.3.2 on wp_head.. i think there is 2 ways to fix this

1. add deregister script into wp_head() , so all jQuery will use jQuery version add by theme add this script before wp_head();
wp_deregister_script('jquery');
2. make your script.js (jQuery functions) into noConflict(); example:
(function(j){
   function YourScript(){

   }

j(document).ready(function(){
    YourScript();
});
})(jQuery.noConflict());
change the $ into j or whatever..it will minimal the conflict :)

I hope this will help .. hehe ;)

Good Luck

562 posts You Reap What You Saw
  • Elite Author
  • Referred between 200 and 499 users
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Has been a member for 4-5 years
  • Author had a Free File of the Month
  • Bought between 1 and 9 items
Bluz says

I got a client with the exact same problem. jquery is called twice. I too would also love a simple and quick soluiton.

From all the solutions you guys presented here, which is the easiest and the most simple ?

629 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • United States
VagrantRadio says

1. Use wp_deregister_script calling it before wp_head(). this will disable plugins from adding another version of jQuery also.

wp_deregister_script('jquery');

2. Use your own

wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js');
wp_enqueue_script('jquery');

3. Associate all $’s to jQuery using noConflict.

The jQuery API has a page with many examples of it’s use.

http://api.jquery.com/jQuery.noConflict/

1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 more
ThemeBlvd says

@DD

Try this -

In your header.php file move the

<?php wp_head(); ?>

BEFORE all your JS files.

Then, at the top of your /js/scripts.js file, put this:

jQuery.noConflict();

If that doesn’t work email me.

562 posts You Reap What You Saw
  • Elite Author
  • Referred between 200 and 499 users
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Has been a member for 4-5 years
  • Author had a Free File of the Month
  • Bought between 1 and 9 items
Bluz says
1. Use wp_deregister_script calling it before wp_head(). this will disable plugins from adding another version of jQuery also.
wp_deregister_script('jquery');

2. Use your own

wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js');
wp_enqueue_script('jquery');

3. Associate all $’s to jQuery using noConflict.

The jQuery API has a page with many examples of it’s use.

http://api.jquery.com/jQuery.noConflict/

Thanks! And thank you too themeblvd :)

by
by
by
by
by
by