2952 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
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
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 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
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Belgium
+1 more
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
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
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/

451 posts Don't be a HATER!
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+6 more
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: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been part of the Envato Community for over 5 years
  • Contributed a free file of the month
+4 more
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
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
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/

1029 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 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: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been part of the Envato Community for over 5 years
  • Contributed a free file of the month
+4 more
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 :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by