首页 > 代码库 > 简单的js模块加载

简单的js模块加载

var check = {} require = function(name, callback){    //name切割成多个模块名,然后转换为URL    //for循环    //这里会运行于iframe中    var s = document.createElement("script")    document.body.appendChild(s)    s.src = http://www.mamicode.com/name"require.exec(" + callback.toString() +",‘"+name +"‘)"    var s = document.createElement("script")    document.body.appendChild(s)    s.text = str;}

  

简单的js模块加载