WordPress and Jquery Conflicts – Fix

by Leo Fisher - November 12th, 2010

This post is for some of you who are running into some errors or funky behaviors in their jQuery code along with WordPress.  Usually it is a Function is Null or doesn’t exist type of error that FireBug reports.

Lately, in some designs I have been using different jQuery effects for different aspects of the sites and then of course what’s WordPress without its plugins where they are bound to also use jQuery for their functionalities.  Simply put, jQuery is conflicting with other libraries.

To possibly alleviate this you can set a Variable with the jQuery.noConflict(); function.  Then replacing any of the dollar signs with the variable you create:

Example:

var $j = jQuery.noConflict();

$j(document).ready(function(){}

To learn more about the problem with other alternatives and get a more in-depth look of the conflict go here: http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Share:
  • Print
  • email
  • Twitter
  • Facebook
  • del.icio.us
  • Add to favorites

DISCLAIMER: In the end, I must include to no avail. I am not a writer (professional at that) I do not like writing. I write these because someones bound to have similar thoughts and some coding problems as me.

Thanks for reading, now read something else that will benefit you. Uncanny Smiley Face.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

« | »