zoukankan      html  css  js  c++  java
  • Iframe载入页面 及 跳转页面

    原文发布时间为:2009-05-05 —— 来源于本人的百度文章 [由搬家工具导入]

    第一个文件 frame1.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>第一个页面</title>
    <script type="text/javascript">
    function setIframe()
    {
       var f=document.getElementById("newframe");
       f.style.display="inline";
       f.src="frame2.html";
    }
    </script>
    </head>

    <body>
    <p>这个是第一个页面。。。。</p>
    <p>
    <input type="button" onclick="setIframe()" value="单击载入第二个页面" />
    <iframe align="center" frameborder="0" marginheight="0" marginwidth="0" name="relnews"
                    id="newframe" scrolling="no" style=" 100%; height: 100%;display:none">
    </iframe>
    </p>
    </body>
    </html>

    第二个文件frame2.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>第二个要载入的页面</title>
    <script type="text/javascript">
    function setIframe()
    {
       var f=document.getElementById("newframe");
       f.style.display="inline";
       f.src="http://hi.baidu.com/handboy";
    }
    </script>
    </head>

    <body>
    这是第二个页面。。。。下面的载入是网址,是模仿了跳转功能,这样跳转不会被拦截
    <p>
    <p>
    <input type="button" onclick="setIframe()" value="单击载入第三个页面" />
    <iframe align="center" frameborder="0" marginheight="0" marginwidth="0" name="relnews"
                    id="newframe" scrolling="no" style=" 100%; height: 100%;display:none">
    </iframe>
    </p>
    <iframe align="center" frameborder="0" marginheight="0" marginwidth="0" id="newframe" scrolling="no" style=" 100%; height: 100%;display:none">
    </iframe>
    </p>
    </body>
    </html>

  • 相关阅读:
    html
    头部标签
    ajax
    分辨率
    js 运动基础
    js DOM
    js定时器
    js数组
    js基础
    例子:js简易日历
  • 原文地址:https://www.cnblogs.com/handboy/p/7153291.html
Copyright © 2011-2022 走看看