• 让iframe子窗体取父窗体地址栏参数(querystring)


    突然用到,记录一下,对地址栏字符串用正则处理最好,有时间研究一下。 主要是思路。
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        
    <title>让iframe子窗体取父窗体地址栏参数(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");//简单做个字符串处理,这里只有一个参数。
                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>
  • 相关阅读:
    html+css学习
    mac安装软件系列
    Versions 出现 SVN Working Copy xxx locked
    linux安装gcc-c++
    linux常用命令
    linux挂载磁盘
    对jquery新增加的class绑定事件
    linux下安装php的mcrypt拓展
    Linux关闭selinux
    linux安装包资源库
  • 原文地址:https://www.cnblogs.com/greatverve/p/1582519.html
Copyright © 2020-2023  润新知