As we all know, there are a lot of jquery version, and some versions of the conflict is very obvious, there are some very useful web-based plug-ins are written in version a, but to achieve the other features must be used in version B. So it is important to live in peace between versions.
1. Here is a function that can be very smooth, very simple to solve the problem.
<script type= "Text/javascript" src= "jquery.js" ></script><script type= "Text/javascript" >var j = Jquery.noconflict (true); </script><script type= "Text/javascript" src= "Jquery-1.7.js" ></script> <script type= "Text/javascript" >$ ("document"). Ready (function () {alert ("FAF");}) J ("Document"). Ready (function () {alert ("FAF");}) </script>
Run this function to transfer the use rights of $ to another jquery library, which avoids collisions between $ objects in different jquery versions.
After running this function, you can only use J to access the first jquery library. For example, where you want to use $ ("div p"), you must change to J ("Div p"). Another jquery library, normally accessed using $.
Note: This function must be run after the jquery file is imported and before the other person's jquery library is imported. If you change a jquery reference object that references a plug-in, the JQuery object reference inside the plugin must be modified to be consistent.
2. Use jquery migrate to restore features that have been deleted or changed in a jquery version to resolve version conflict issues.
Dealing with compatibility issues with different versions of jquery