遇到其他js文件也用$包装了函数。可以把jQuery放在后面,并释放下$的控制权,也可以换个字符替代原来的$,例如$$ 或者,jQuery//jQuery释放$的控制权$$ = $.noConflict(); <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8"> <title>Title</title> <script src="itcast.js"></script> <script src="jquery-1.12.4.js"></script> <script>console.log($);//jQuery释放$的控制权 $$ = $.noConflict();// jQuery(function () {// });$$(function () { }); </script></head><body></body></html> |
|