define namespace in JS
摘要:
function regNamespace(namespace) { var parts = namespace.split("."); var root = "window"; for (var i = 0; i < parts.length; i++) { var part = parts[i]; root = root + "." + part; if (eval(root) == undefined) { eval(root + "= {};") } }}... 阅读全文
posted @ 2013-05-11 01:35 shcity 阅读(276) 评论(0) 推荐(0) 编辑