首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

施用 nodejs 形式的语法来规整 js

2012-09-08 
使用 nodejs 形式的语法来规整 js/* * 使用 nodejs 形式的语法来规整 js */ void function() {var mapping

使用 nodejs 形式的语法来规整 js

/* * 使用 nodejs 形式的语法来规整 js */ void function() {var mapping = {}, cache = {};window.define = function(id, func) {mapping[id] = func};window.require = function(id) {if (!/\.js$/.test(id)) {id += ".js"}if (cache[id]) {return cache[id]} else {return cache[id] = mapping[id]()}}}();define("scripts/core/demo.js", function(exports) {exports = {};exports.start = function() {alert("Hello World !")};return exports});require('scripts/core/demo').start();
?

热点排行