天天看点

js获取项目的ip和端口

var cur = window.document.location.href;
var pathname = window.document.location.pathname;
var pos = cur.indexOf( pathname );
var localhostPath = cur.substring( 0, pos );

console.log( localhostPath );      

继续阅读