获取path路径

Posted on 2017-05-23 09:26  发飙的木鱼  阅读(37)  评论(0)    收藏  举报

var SScurWwwPath = window.document.location.href;
var SSpathName = window.document.location.pathname;
var SSpos = SScurWwwPath.indexOf(SSpathName);
var SSlocalhostPaht = SScurWwwPath.substring(0, SSpos);
if(SSlocalhostPaht.indexOf("localhost")>=0){
SSlocalhostPaht+="/chinadatapay.user";
}