var curWwwPath=window.document.location.href;
var pathName=window.document.location.pathname;
var pos=curWwwPath.indexOf(pathName);
var localhostPaht=curWwwPath.substring(0,pos);
console.log("window.document.location.href>>",window.document.location.href);
console.log("window.document.location.pathname>>",window.document.location.pathname);
console.log("pos>>",pos);
console.log("localhostPaht>>",localhostPaht);