封装jquery适配seajs模式
来源:互联网 发布:淘宝网夏季女装上衣 编辑:程序博客网 时间:2024/06/01 09:38
jquery背身对于AMD支持很好,对于cmd支持不是很好,如果使用seajs开发框架,需要注意封装jquery,以适用;
封装方法无非更改jquery源码,
在jquery源码中找到
if ( typeof define === "function") { define( "jquery", [], function() { return jQuery; }); }然后替换为
if ( typeof module === "object" && module && typeof module.exports === "object" ) { module.exports = jQuery; } else { if ( typeof define === "function" && define ) { define( "jquery", [], function () { return jQuery; } ); } } if ( typeof window === "object" && typeof window.document === "object" ) { window.jQuery = window.$ = jQuery; }这样就可以了;
针对压缩后的jquery,找到
"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});然后替换为
"function"==typeof define&&define.cmd&&define("jquery",[],function(){return m});
0 0
- 封装jquery适配seajs模式
- 把jQuery的类、插件封装成seajs的模块的方法
- seajs 使用jquery插件
- seajs加载jquery
- seajs如何引入jquery?
- jquery转化为seajs模块
- seajs 2.3.0 添加jquery
- seajs 2.3.0 添加jquery
- seajs如何正确加载jquery
- bootstrap封装成seajs cmd模块
- jQuery插件封装:浮动div模式框
- jquery插件封装:弹出iframe模式框
- jQuery插件开发模式(组件封装)
- seajs模块化jQuery与jQuery插件
- seajs模块化jQuery与jQuery插件
- seajs模块化jQuery与jQuery插件
- seajs模块化jQuery与jQuery插件
- SeaJS
- NumPy的详细教程
- Android 中几个Context的区别,getApplicationContext(),Activity.this,getBaseContext()
- red5 + rtmp篇2
- POJ 1789 Truck History
- UIVIEW 设置圆角 +边框阴影
- 封装jquery适配seajs模式
- hdu 3367 Pseudoforest(伪森林)
- iOS开发UI篇—核心动画(UIView封装动画)
- 命令行的艺术
- CGContext小记
- 1 tornado入门
- 【剑指offer】5.3时间效率与空间效率的平衡——面试题35:第一个只出现一次的字符
- 高精度模板
- linux C中调用shell命令和运行shell脚本