Return to Snippet

Revision: 35607
at November 11, 2010 00:01 by mike-tempest


Initial Code
jQuery(function( $ ){
    //Insert your javascript code here

});

Initial URL
http://www.michaeltempest.com

Initial Description
Hello,

I have been developing with jQuery for just over a year now, I thought I would share something with you that I have found pretty time saving over the past few months.

If you have ever had javascript conflicts due to several different javascript libraries being used you will understand the need for using this method.

Rather than using the documented $(document).ready method of starting any javascript functionality on document load. I recommend that you give the alternative shown below. This is due to the common conflict between Javascript libraries using the $ symbol. By writing your document ready in this way, any $ symbols within this declaration will be ignored by all other javascript libraries. 

Meaning you will no longer need to use the no conflict method of solving the same problem

Initial Title
Rather than using $(document).ready / alternative no conflict

Initial Tags
javascript, jquery

Initial Language
jQuery