First, load prototype and then jquery.
Method 1: The jquery library and all its plug-ins are in the jquery namespace, and global variables are also stored in the jquery namespace.
Use jquery. noconflict (); it can be called at any time after jquery is loaded, and the $ symbol's right to use is returned to other JS libraries, when jquery creates its own namespace, it saves $ of other libraries in its own variable.
<HTML>
Method 2: If you still want to use a short character like $, you can assign the return value of jquery. noconflict () to a variable. This variable is short for jquery. Of course you can use any string other than $, for example:
<HTML>
Method 3: If you still want to use $ instead of other characters, you can. Generally, programmers prefer to do this, because almost all the code written in this way does not need to replace the original $ symbol. The concept of namespace is used to encapsulate all jquery code in the ready event namespace range of the document, such as jquery (document). Ready (enter jquery code here)
<HTML>
Case 2: First load jquery and then load prototype
Loading in this order does not cause the $ symbol of other JS libraries to be occupied by jquery. Therefore, the code of other JS libraries can be used as usual without any modification. jquery can be used to replace $. For example:
<HTML>
Or if you don't want to write such long characters as jquery, you can use another method:
var $j = jQuery;