Home > Web Front-end > JS Tutorial > How to use $ in jQuery to avoid conflicts with other libraries_jquery

How to use $ in jQuery to avoid conflicts with other libraries_jquery

WBOY
Release: 2016-05-16 15:45:17
Original
1127 people have browsed it

In Jquery, $ is an alias of JQuery. All places where $ is used can also be replaced by JQuery. For example, $('#msg') is equivalent to JQuery('#msg'). However, when we introduce multiple js libraries and the $ symbol is also defined in another js library, then there will be a conflict when we use the $ symbol. The following is an example of introducing two library files jquery.js and prototype.js.
The first case: jquery.js is introduced after prototype.js, such as:

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template