Solution to share conflicts between jquery and other JS frameworks (such as mootools, prototype, dojo, and Yui)

Source: Internet
Author: User
Tags mootools

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.

 

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.