天天看點

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 );      

繼續閱讀