js创建命名空间
CreateNameSpace: function () { var nameSpaceObjec = arguments[0].split('.'); var currentNameSpaceName = ""; $.each(nameSpaceObjec, function (index, item) { if (index == 0) { currentNameSpaceName = item; } else { currentNameSpaceName += '.' + item; } var evalStr = "if(typeof " + currentNameSpaceName + "=='undefined'){" + currentNameSpaceName + "={}; }"; eval(evalStr); }); }