package.js
----------
/**
* @author Van
* @Version: 1.0
* @DateTime: 2012-11-11
*/
function $package(ns) {
if (typeof(ns) != "string")
return;
ns = ns.split(".");
var o, ni;
for (var i = 0, len = ns.length;i < len, ni = ns[i]; i++) {
try {
o = (o ? (o[ni] = o[ni] || {}) : (eval(ni + "=" + ni + "||{}")))
} catch (e) {
o = eval(ni + "={}")
}
}
}
项目中用到,但是不理解,用过或者了解的同学给解释下
翻翻过去那场雪
相关分类