生·生活

asp.net旅行

 

location.search和location.pathname

http://localhost/test/test.htm?id=1

<html>
<head>
</head>
<body>
<script languge=javascript>
alert(window.location.pathname);   --返回   /test/test.htm
alert(window.location.search);        --返回   ?id=1
alert(window.location.href);             --返回   http://localhost/test/test.htm?id=1
</script>
</body>
</html>

posted on 2006-11-09 22:05  厦门刀客  阅读(265)  评论(0)    收藏  举报

导航