js取当前项目名称

    function getContextPath(){
        var path = window.location.href;
        path = path.substring(0, path.lastIndexOf("/"));
        path = path.substring(path.lastIndexOf("/"), path.length);
        return path;
    }
    window.alert(getContextPath());

 

posted @ 2014-09-26 10:13  哎呦喂,我的小祖宗╰つ  阅读(214)  评论(0编辑  收藏  举报