JavaScript 动态加载 其它JS文件

来源:互联网 发布:mysql最新版本是多少 编辑:程序博客网 时间:2024/05/12 22:53

if (window["Page"] == null) window["Page"] = Object();



Page.$ = function (month) {
    var s1 = month.split('.');
    if (s1.length == 2 && window[s1[0]] != null && window[s1[0]][s1[1]] != null) return window[s1[0]][s1[1]];
    //
    if (s1.length == 2) {
        $('body').append("<script type='text/javascript' src='../JS/" + s1[0] + "/" + month + ".js'></script>");
        return window[s1[0]][s1[1]];
    }
    return new Object();
}

0 0
原创粉丝点击