$沖突的解決方案
遇到其他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>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/11143.html
標籤:jQuery
上一篇:jQuery---each方法
