欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

seajs加載jquery時(shí)提示$ is not a function該怎么解決

 更新時(shí)間:2015年10月23日 09:46:25   投稿:mrr  
這篇文章主要介紹了seajs加載jquery時(shí)提示$ is not a function該怎么解決的相關(guān)資料,需要的朋友可以參考下

jquery1.7以上的都支持模塊化加載,只是jquery默認(rèn)的是支持amd,不支持cmd。所以要用seajs加載jquery時(shí),我們需要稍微做下改動(dòng),需要把以下內(nèi)容做下修改,具體修改方式如下:

 if (typeof define === "function" && (define.amd)) {
   define( "jquery", [], function() {
     return jQuery;
   });
 }

改成

 if (typeof define === "function" && (define.amd || define.cmd)) {
   define( "jquery", [], function() {
     return jQuery;
   });
 }

 if (typeof define === "function") {
   define( "jquery", [], function() {
     return jQuery;
   });
 }

通過以上代碼的修改就可以成功解決seajs加載jquery時(shí)提示$ is not a function問題,希望對(duì)大家有所幫助。

相關(guān)文章

最新評(píng)論