zoukankan      html  css  js  c++  java
  • H50080:html url 地址获取id 嵌入iframe并动态传入id

    1,访问地址:

    https://www.xxx.com/xxx.html?id=bmRMH3GfST

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>空间</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <style>
            iframe {
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                height: 100%;
                width: 100%;
            }
        </style>
    
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?4447de3b4a47f73e510bb33a690706eb";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    // 获取url参数名
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null){
            return unescape(r[2]);
     
        }else{
            return null;
        }
    }
    function cc(){
        document.getElementById('frameid').src="https://www.xxx/ys/player.html?id="+GetQueryString('id');
    }
    
    </script>
    
    </head>
    
    
    <body onload="cc()">
    <iframe name="son" id="frameid" src="" width="100%" height="100%" scrolling="no" frameborder="no"  security="restricted" sandbox="allow-top-navigation allow-same-origin allow-forms allow-scripts">
    </iframe>
    
    </body>
    </html>
    琥珀君的博客
  • 相关阅读:
    linux 换源
    Jedis使用
    mysql 安装
    ORACLE 11g安装
    网易有道云笔记去除左下角广告
    No module named 'urllib2'
    python+Eclipse+pydev环境搭建
    python-正则表达式基础
    [转]SpringMVC Controller介绍及常用注解
    【Android自学日记】搭建Android开发环境
  • 原文地址:https://www.cnblogs.com/eliteboy/p/15415404.html
Copyright © 2011-2022 走看看