js获取当前路径并截取 var str = window.location.href;// str = 'https://localhost:8080/mark' var index = str .lastIndexOf(":"); str = str .substring(0,index + 1); console.log(str);//结果为:https://localhost: 来源:https://www.cnblogs.com/lvxisha/p/11660232.html 标签 js获取当前url var js