jQuery noConflict wrappers on WordPress

January 10th, 2010 By WP Tricks Posted in Tips

WordPress is wonderful publishing platform with many JavaSript Framework including jQuery. Until today jQuery is one of my favorite JavaScript library, it’s more easy, a lot of plugin available and I have wonderful jQuery guru ;)

Some problem on jQuery and other JavaScript library is, conflict between this library. To eliminate this problem, jQuery has method by added some code jQuery.noConflict(); and don’t worry, WordPress has been added some tricks and added this featured too, using jQuery with other libraries in WordPress is easy, all need to do just write your JavaScript Code like on this example

jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function
});

Sponsored Links


That wrapper will cause your code to be executed when the page finishes loading, and the $ will work for calling jQuery. If, for some reason, you want your code to execute immediately (instead of waiting for the DOM ready event), then you can use this wrapper method instead:

(function($) {
    // $() will work as an alias for jQuery() inside of this function
})(jQuery);

I hope this tricks for using jQuery on WordPress working great on your blogs and you didn’t found any problem on it.

Related Posts

  1. Replace jQuery of WordPress with Google AJAX Library
  2. Using jQuery 1.4 as Default on WordPress
  3. How To Load Gravatar on the Fly

jQuery noConflict wrappers on WordPress On The NET

jQuery noConflict wrappers on WordPress # WordPress Tricks & Tips

WordPress is wonderful publishing platform with many JavaSript Framework including jQuery. Until today jQuery is one of my favorite JavaScript library, it's read more

Source: http://wptricks.net/jquery-noconflict-wrappers-on-wordpress/

Function Reference/wp enqueue script « WordPress Codex

jQuery noConflict wrappers . Note: The jQuery library included with WordPress loads in "no conflict" mode. This is to prevent compatibility problems with other javascript libraries ... read more

Source: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Daily Tip: Adding Custom JS to WordPress? Remember jQuery ...

If you’re adding some extra jQuery to customize your WordPress site and it doesn’t seem to be working, remember that the copy of jQuery that WP loads is in “no conflict ... read more

Source: http://wpmu.org/daily-tip-adding-custom-js-to-wordpress-remember-jquery-noconflict-wrappers/comment-page-1/

JQuery # WordPress Tricks & Tips

jQuery noConflict wrappers on WordPress January 10th, 2010 By WP Tricks Posted in Tips read more

Source: http://wptricks.net/tag/jquery/

Wordpress Featured Post Slideshow | Upside Down City

This is code that generates the wrappers ... Notice that I did not call JQuery with the $ shortcut. By default the jQuery included with wordpress uses jQuery.noConflict( ) so it ... read more

Source: http://www.upsidedowncity.net/wordpress-featured-post-slideshow/


Amazing Touch


1 Trackbacks


Add Your Comment

Gravatar