实用的JS获取当前网页的URL
用javascript获取url网址信息
<script type="text/javascript">
document.write("location.host="+location.host+"<br>");
document.write("location.hostname="+location.hostname+"<br>");
document.write("location.href="+location.href+"<br>");
document.write("location.pathname="+location.pathname+"<br>");
document.write("location.protocol="+location.protocol+"<br>");
</script>
执行 用javascript获取url网址信息 代码效果如下
location.host=www.bnxb.comlocation.hostname=www.bnxb.com
location.href=http://www.htmlw.cn/bc/2008/0306/article_1860.html
location.pathname=/bc/2008/0306/article_1860.html
顶(3)
踩(0)
- 最新评论
