用正则把当前网址的协议 和 主机名 和 端口 替换掉,这样写为啥不对??
<script>
var reg = new RegExp("^"+location.protocol +"\/\/"+ location.host+"","i");
var url = location.replace(reg,"");
alert(url);
</script>
<script>
var reg = new RegExp("^"+location.protocol +"\/\/"+ location.host+"","i");
var url = location.replace(reg,"");
alert(url);
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货