具体一点好吗,将所有框架名称列出到下拉框中

解决方案 »

  1.   

    带框架的页面01.html:
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <frameset cols="180,25,*" id="weldown" frameborder="NO" border="0" framespacing="0">
        <frame src="munelist.html" name="webLeft" id="webLeft" scrolling="auto" noresize>
        <frame src="frtool.html" name="webTool" scrolling="NO" noresize>
        <frame src="02.html" name="webMain" scrolling="auto">
    </frameset>
    <body>
    </body>
    </html>
    select所在的叶面02.html:
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script language="javascript">
    function showFr()
    {
    for(var i=0;i<parent.frames.length;i++)
    {
    document.fr.sfr.options[document.fr.sfr.options.length] = new Option(parent.frames[i].name,parent.frames[i].name);
    }
    }
    </script>
    </head><body onLoad="showFr();">
    <form name="fr">
    <input type="button" value="count frame" onClick="alert(parent.frames.length);"><br><br>
    <select name="sfr"></select>
    </form>
    </body>
    </html>