随笔分类 -  requireJs

已有插件支持requirejs
摘要:define(["jquery"],//Requirejqueryfunction($){//把你原来的插件代码放这里吧,这样就行了//注意文件命名}); 阅读全文
posted @ 2013-12-19 09:30 c3tc3tc3t 阅读(149) 评论(0) 推荐(0)
RequireJs学习笔记之Define a Module
摘要:简单的键值对定义define({ color: "black", size: "unisize"});如果一个模块没有任何依赖,又需要做用一个函数做一些事情,直接定义一个函数然后传给define()//my/shirt.js 返回定义的模块是一个键值对define(function () { //Do setup work here return { color: "black", size: "unisize" }});使用需要依赖的函数来定义模块如果一个模块有依赖,第一个参数应该是一组这个模块依赖的函数名 ,第 阅读全文
posted @ 2013-11-04 16:17 c3tc3tc3t 阅读(312) 评论(0) 推荐(0)
RequireJs学习笔记之data-main Entry Point
摘要:You will typically use a data-main script to set configuration options and then load the first application module. Note: the script tag require.js generates for your data-main module includes the async attribute. This means that you cannot assume that the load and execution of your data-main script 阅读全文
posted @ 2013-11-03 13:09 c3tc3tc3t 阅读(592) 评论(0) 推荐(0)