Transferred from: Zend lab
Note: jquery official document:Using jquery with other libraries
This articleArticleIt will help you solve the sharing conflicts between jquery and other JS frameworks and realize coexistence between jquery and mootools. Recently, I am working on some CRM interfaces, including a set of interface libraries, which are developed based on mootools. However, I will consider introducing some new components, these components are developed based on jquery, such as leightbox. After jquery was introduced, the results showed that $ had their own definitions in both frameworks, and the conflicts also appeared. After Collection, three solutions are provided on the Internet.
Method 1,
<HTML>
Method 2,
<HTML> CodePut jquery (document) in document ready ). ready (function ($) {// $ ("Div") defined for jquery here "). hide () ;}); // here is the definition of mootools $ ('someid '). style. display = 'none'; </SCRIPT>
Method 3,
<HTML>
Zend lab strongly recommends that you use the third method to solve the shared conflicts between jquery and other JS frameworks. The reason is that it is short and can achieve the expected results, and there is no location restriction as in the second method. You can use it wherever you want.