标签:
var mdm = window.mdm ? window.mdm : {};
mdm.namespace = function (str) {
var arr = str.split(".");
var o = mdm;
for (i = (arr[0] == "mdm") ? 1 : 0; i < arr.length; ++i) {
o[arr[i]] = o[arr[i]] || {};
o = o[arr[i]];
}
};
if (!("fun" in window)) {
mdm.namespace("fun.fun1");
}
console.log(mdm.fun)
标签:
原文地址:http://my.oschina.net/u/1992917/blog/382492