<script type="text/javascript">
function sy(){
var curWwwPath = window.document.location.href;
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
var localhostPaht = curWwwPath.substring(0,pos);
var projectName = pathName.substring(0,pathName.substr(1).indexOf('/')+1);
return (localhostPaht + projectName);
}
</script>
js实现在HTML页面获取项目名路径
最新推荐文章于 2021-07-03 12:19:40 发布