请各位大侠帮忙解决下:我的main.html里包含了几个frame页面(leftFrame,topFrame,middelFrame...),现在我想通过点击left.html里的菜单在top.thml里显示该菜单的下一级菜单,改怎么操作啊,等着,急!!!

解决方案 »

  1.   

    left 里面:
    <a href="menu1_sub.html" target="topFrame">菜单一</a>
    top frame:
    <iframe name="topFrame" ...........></iframe>
      

  2.   

    你知道两个方法就行了
    iframe里的页面调用父窗口的程序:
    parent.函数名();
    parent.变量名父窗口调用子窗口的程序:
    document.frames['框架名'].函数名();
    document.frames['框架名'].变量名;所以你需要的A框架调用B框架的程序写法比较复杂点
    parent.document.frames['框架B'].函数名()
      

  3.   


    那个<iframe...>我不知道该放到哪里去啊
      

  4.   

    所以你需要的A框架调用B框架的程序写法比较复杂点
    parent.document.frames['框架B'].函数名()
    [/Quote]
    能举个例子吗
      

  5.   

    topFrame应该包含在你的main.html里面
    楼主,你自己不都写出来了吗?
      

  6.   

    举例
    父窗口代码:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head>
    <body>
    <p><iframe name="I1" src="new_page_2.htm">浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe>
    <iframe name="I2" src="new_page_3.htm">浏览器不支持嵌入式框架,或被配置为不显示嵌入式框架。</iframe></p>
    </body>
    </html>
    I1里的代码:
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 2</title>
    </head><body>
    <script language=javascript>
    function alertA(){
    alert('a');
    }
    </script>
    </body></html>I2里的代码:
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 3</title>
    </head><body><p><input type="button" value="按钮" name="B3" onclick="parent.document.frames['I1'].alertA();"></p></body></html>
    运行父窗口,点击按钮即可执行I1的代码
      

  7.   

    怎么我调用出来的是整个menu_sub.html页面,我要的只是局部刷新啊
      

  8.   

    就是说,我只想要topFram里的一个table刷新,而不是整个topFram刷新
      

  9.   

    在父窗口 中开辟一个全局变量window.allF={};window.allF.abc=function(){};任何地方都能调用window.allF.abc()
      

  10.   


    这是mail.html文件<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>信息管理系统</title>
    </head><frameset rows="98,*,8" frameborder="no" border="0" framespacing="0">
      <frame src="top.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" />
      <frame src="center.html" name="mainFrame" id="mainFrame" />
      <frame src="down.html" name="bottomFrame" scrolling="No" noresize="noresize" id="bottomFrame" />
    </frameset>
    <noframes><body>
    </body>
    </noframes></html>