<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    關于Frame的取值

    testFrame.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>frame測試</title>
    </head>

    <frameset rows="390,*" frameborder="NO" border="0" framespacing="0">
      
    <frame src="frame1.htm" name="topFrame" scrolling="NO" noresize >
      
    <frame src="frame2.htm" name="mainFrame">
    </frameset>
    <noframes><body>
    </body></noframes>
    </html>
    frame1.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"
    >
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>frame測試</title>
    <script>
    function test1()
    {
      alert(parent.mainFrame.frame2Variable);
      parent.mainFrame.frame2Method();
      alert(parent.mainFrame.document.getElementById('frame2FormValue').value)
    }

    function test2()
    {
      alert(window.frames['iframe'].iframeVariable);
      window.frames['iframe'].iframeMethod();
      alert(window.frames['iframe'].document.getElementById('iframeFormValue').value)
    }

    </script>
    </head>

    <body>
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    <br>
    frame1.htm!
    <br>
    <form name='frame2Form'>
    <input type=button value='調用frame2.htm中的變量和方法' onclick="test1()"><br>
    <input type=button value='調用iframe.htm中的變量和方法' onclick="test2()"><br>
    <input type=text id='frame1FormValue' value='frame1.htm中的表單元素的值' ><br>
    </form>
    <br>
    這是frame1.htm中的IFrame
    <br>
    <Iframe name='iframe' src='iframe.htm' width='800' height="600"/><br>

    frame1.htm結束!
    <br>
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    <br>
    </body>
    </html>
    frame2.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"
    >
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>frame測試</title>
    <script>
    var frame2Variable='frame2.htm中的變量!';
    function frame2Method()
    {
    alert('frame2.htm中的方法!');
    }

    </script>
    </head>

    <body>
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    <br>
    frame2.htm!
    <br>
    <form name='frame2Form'>
    <input type=text id='frame2FormValue' value='frame2.htm中的表單元素的值' >
    </form>
    frame2.htm結束!
    <br>
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    <br>
    </body>    
    </html>
    iframe.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"
    >
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>frame測試</title>
    <script>
    var iframeVariable='iframe.htm中的變量!';
    function iframeMethod()
    {
    alert('iframe.htm中的方法!');
    }

    function parentMethod()
    {
    parent.test1();
    parent.test2();
    }

    function parentFormValue()
    {
    alert(parent.document.getElementById('frame1FormValue').value);
    }

    </script>
    </head>

    <body>
    <form name='iframeForm'>
    <input type=text id='iframeFormValue' value='iframe.htm中的表單元素的值' >
    <input type=button  value='調用frame1.htm中的方法' onclick='parentMethod()'>
    <input type=button  value='輸出frame1.htm中的表單元素' onclick='parentFormValue()'>
    </form>
    Iframe的frame!

    </body>
    </html>



    posted on 2007-09-26 13:28 我為J狂 閱讀(1213) 評論(0)  編輯  收藏 所屬分類: Web

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導航

    統計

    常用鏈接

    留言簿(11)

    隨筆分類(48)

    文章分類(29)

    常去逛逛

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲国产成人久久精品软件| 亚洲综合区图片小说区| 伊人久久亚洲综合影院首页| 午夜无码A级毛片免费视频| 国产l精品国产亚洲区在线观看| 青青操免费在线视频| 亚洲精品无码专区在线在线播放 | 国产亚洲大尺度无码无码专线 | 亚洲国产精品综合一区在线| 最近免费中文字幕大全免费版视频| 中文字幕亚洲综合精品一区| 91免费国产自产地址入| 亚洲国产成a人v在线观看| 在线播放高清国语自产拍免费 | 亚洲AV色香蕉一区二区| 美女内射毛片在线看免费人动物| 亚洲无圣光一区二区| 成年女人色毛片免费看| 国产成人亚洲毛片| 中文字幕精品亚洲无线码二区 | A片在线免费观看| 亚洲色偷偷偷网站色偷一区| 夫妻免费无码V看片| 成人a毛片免费视频观看| 亚洲av丰满熟妇在线播放| **俄罗斯毛片免费| 色天使亚洲综合一区二区| 国产亚洲精品a在线无码| 91精品免费国产高清在线| 亚洲国产成人精品无码区花野真一| 亚洲成av人片在线观看天堂无码| 国产午夜免费高清久久影院| 亚洲色欲色欲www| 亚洲一区无码精品色| 91短视频免费在线观看| 污视频网站免费观看| 亚洲高清中文字幕| 亚洲AV无码一区二区三区在线观看| 暖暖日本免费中文字幕| 国产精品日本亚洲777| 亚洲第一精品在线视频|