亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

讓iframe子窗體取父窗體地址欄參數(shù)(querystring)

 更新時間:2009年10月13日 20:40:57   作者:  
突然用到,記錄一下,對地址欄字符串用正則處理最好,有時間研究一下。 主要是思路。
復制代碼 代碼如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>讓iframe子窗體取父窗體地址欄參數(shù)(querystring)</title>
<script type="text/javascript">
function f(){
//http://localhost:4101/MyFiles/netshop/ShopType.aspx?tid=1
var url = window.location.href;//取得地址欄
var pos = url.indexOf("tid");//簡單做個字符串處理,這里只有一個參數(shù)。
var tid = url.substring(pos+4);//取tid=后面的字符串,所以+4
document.getElementById("gv_frame").src = "ShopType.aspx?tid=" + tid;
}
</script>
</head>
<body onload="f();">
<iframe id="gv_frame"></iframe>
</body>
</html>

相關文章

最新評論