Handling conflicts between jquery versions

Source: Internet
Author: User
Tags jquery library

handling conflicts between jquery versions
front-end developers all know that there are a lot of jquery versions, and the conflict is tangled.
For example, when I first came to this company, the back end of the buddies with the jquery 1.3.2, I went, the man has not been updated for a long time.
The effect plug-ins I wrote are the newest jquery1.7.1.
not compatible with the egg pain Ah, refer to previous information, reading. Find a peaceful coexistence
<script type= "Text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/ Jquery.min.js "></script>
<script type=" Text/javascript ">
var j = jquery.noconflict (true);
</script>
<script type= "Text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/ Jquery.min.js "></script>
<script type=" Text/javascript ">
$ (" document "). Ready (function () { Br>alert ("jquery");
})
J ("Document"). Ready (function () {
Alert ("JavaScript");
})
</script>
Roughly means that the use of permissions is given to another jquery library, which avoids conflicts between the $ objects in different jquery versions. The above code can pop up two popup boxes, you can release the conflict between different versions.
After running this function, you can only use J to access jquery/1.3.2/. For example, if you want to use $ ("div span"), you need to change to J ("Div span"). Another jquery library is working,

Handling conflicts between jquery versions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.