jQuery Conflict!!! Solution Here

jquery

Today i am gonna deal with a topic which had been troubled many times in past one year.I am a web developer.So when i want to use jQuery effects for slider,validation,sliding forms etc.So when i write for,some functionality doesn’t work due to jQuery conflict.Today at very first morning, i got a solution which is permanent and perfect in all aspects.

Please follow these steps to avoid jQuery conflicts on your site:-
1. First of all try out this code:-

<script type=”text/javascript”>
jQuery.noConflict();
jQuery(document).ready(function(jQuery) {
// Code that uses jQuery’s $ can follow here.Please write code using jQuery not $
});
</script>

2. Remember this point:- If you are using latest jquery.js then use jQuery instead of $ otherwise use $.Because older jquery js files used to use $ and newer js files having jQuery.
3. Now Above two are common solution,those can be found after google it out.
4. Now if your problem still exists, then use this trick:-
For WordPress User,include your jQuery js files before <?php wp_head(); ?> like this:-

<?php
$wp_page_no=7;
if(is_page($wp_page_no))
{
wp_deregister_script( ‘jquery’ );
wp_register_script( ‘jquery’, “http://www.aviontechnologyinc.com/wp-content/themes/Aviontechnology/js/jquery.js); //first js
wp_enqueue_script( ‘jquery’ );
wp_deregister_script( ‘jquery’ );
wp_register_script( ‘jquery’, “http://code.jquery.com/jquery-1.4.4.min.js); //second js
wp_enqueue_script( ‘jquery’ );
}
//So these js will be load for only page no.7 not all pages.
?>

5. Important Part: Now open these two js files and replace $ with jQuery and save these two.and run your website.

14 thoughts on “jQuery Conflict!!! Solution Here

  1. I simply want to mention I am just new to blogging and definitely liked your web page. Most likely I’m want to bookmark your blog . You definitely come with very good article content. Bless you for revealing your web-site.

  2. Does your website have a contact page? I’m having trouble locating it but, I’d
    like to send you an email. I’ve got some suggestions for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it expand over time.

  3. Hi there! This article could not be written any better! Looking at this article reminds me of my previous roommate! He continually kept talking about this. I most certainly will forward this information to him. Pretty sure he’ll have a good read. I appreciate you for sharing!|

Leave a reply to Mayur Patil (@mayurdpatil) Cancel reply