<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狂 閱讀(1220) 評論(0)  編輯  收藏 所屬分類: Web

    <2025年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    導航

    統計

    常用鏈接

    留言簿(11)

    隨筆分類(48)

    文章分類(29)

    常去逛逛

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 久久精品a亚洲国产v高清不卡| 亚洲区日韩区无码区| 亚洲午夜精品一区二区| 精品女同一区二区三区免费站| 国产亚洲精品福利在线无卡一 | 日本特黄特色aa大片免费| 亚洲第一成人在线| 成年人视频在线观看免费| 中文字幕在线观看亚洲日韩| 噼里啪啦电影在线观看免费高清| 韩国18福利视频免费观看| 午夜国产精品免费观看| 亚洲免费观看在线视频| 乱爱性全过程免费视频| 久久久久亚洲精品无码网址| 精品一区二区三区免费观看| 午夜寂寞在线一级观看免费| 亚洲AV噜噜一区二区三区| 亚洲成AV人网址| a级在线观看免费| 亚洲国产精品一区二区久| 免费av欧美国产在钱| 国产在亚洲线视频观看| 浮力影院亚洲国产第一页| 久草免费福利视频| 亚洲一区二区三区四区视频| 日韩a级毛片免费视频| 一区二区在线免费视频| 亚洲天天做日日做天天看| 久久久www成人免费毛片| 视频一区在线免费观看| 丁香五月亚洲综合深深爱| AAA日本高清在线播放免费观看| 亚洲精品福利视频| 卡1卡2卡3卡4卡5免费视频| 亚洲国产二区三区久久| 野花高清在线观看免费完整版中文| 久久久久久亚洲精品无码| 亚洲一区二区三区无码中文字幕| 亚洲爆乳无码专区www| 久久99亚洲综合精品首页|