直接上代码不费话了。
A页代码:
<a href="Default.aspx?id=http://www.cnblogs.com/leeyongze">打开</a>
Default.aspx为接收页(B页),
B页代码:
1 <script type="text/javascript">
2 window.onload = newhttp;
3 function Parameter() {
4 var Request = new function () {
5 this.search = window.location.search;
6
7 this.QueryString = new Array();
8
9 var tmparray = this.search.substr(1, this.search.length).split("&")
10 for (var i = 0; i < tmparray.length; i++) {
11 var tmpStr2 = tmparray[i].split("=");
12 this.QueryString[tmpStr2[0]] = tmpStr2[1];
13 }
14 }
15 var id = Request.QueryString["id"];
16 alert(id);
17 }
18 </script>
2 window.onload = newhttp;
3 function Parameter() {
4 var Request = new function () {
5 this.search = window.location.search;
6
7 this.QueryString = new Array();
8
9 var tmparray = this.search.substr(1, this.search.length).split("&")
10 for (var i = 0; i < tmparray.length; i++) {
11 var tmpStr2 = tmparray[i].split("=");
12 this.QueryString[tmpStr2[0]] = tmpStr2[1];
13 }
14 }
15 var id = Request.QueryString["id"];
16 alert(id);
17 }
18 </script>