<frameset rows='100,400'>
    <frame name=top src="top.htm"> 
    <frameset  cols="260,*">
        <frame name=left src=""> 
    <frame name=right src="">
    </frameset>
</frameset>请问top.htm中的函数open()应该怎样写?
function open(){
在left 中打开1.htm
在right中打开2.htm
}

解决方案 »

  1.   

    parent.frames[left].href="1.htm";类似的这样做吧.
      

  2.   

    top.htm<script>
    function openWin(type){
    if(type=="left")
    {
    window.parent.frames['left'].location='1.htm';
    }
    if(type=="right")
    {
    window.parent.frames['right'].location='2.htm';
    }
    }
    </script><input type="button" value="打开LEFT" onclick="openWin('left')"/>
    <input type="button" value="打开Rigth" onclick="openWin('right')"/>
      

  3.   

    没写清楚,请原谅,就是想敲一下,在2个frame中,各自打开一个文件
    top.htm
    <input type=submit value='open' onclick=open()>
    function open(){ 
    在left 中打开1.htm 
    在right中打开2.htm 
    }
      

  4.   

    top.htm
    open是window方法名,用其它名称
    <script>
    function openWin(){
    window.parent.frames['left'].location='1.htm';
    window.parent.frames['right'].location='2.htm';
    }
    </script><input type="button" value="open" onclick="openWin()"/>