jQuery noConflict wrappers on WordPress


Sponsored Links




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
});


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.

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net


3 Responses to jQuery noConflict wrappers on WordPress

  1. Pingback: How To Using jQuery 1.4 as Default on WordPress # WordPress Tricks & Tips

  2. Pingback: How to remove the link parent pages wp_list_pages in WP # WordPress Tricks & Tips

  3. Pingback: wp-popular.com » Blog Archive » jQuery noConflict wrappers on WordPress # WordPress Tricks

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>