码迷,mamicode.com
首页 > Web开发 > 详细

seajs加载jquery提示$ is not a function

时间:2015-10-23 10:03:48      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

jquery1.7以上的都支持模块化加载,只是jquery默认的是支持amd,不支持cmd。所以要用seajs加载jquery,需要稍微改下jquery

 

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

改成

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

1 if (typeof define === "function") {
2     define( "jquery", [], function() {
3         return jQuery;
4     });
5 }

就可以了

seajs加载jquery提示$ is not a function

标签:

原文地址:http://www.cnblogs.com/ewqv/p/4903480.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!