本帖最后由 wujun_dry 于 2010-07-21 09:13:01 编辑

解决方案 »

  1.   

    不管是<a>还是<form>,都可以添加参数target。
      

  2.   

    我想在middle中显示$strLeft,在right中显示$strRight
      

  3.   

    用xmlhttp发送请求给action.php,然后接收返回的字符串,用JavaScript的document.parent处理框架的显示。
      

  4.   

    佐罗大哥,“用JavaScript的document.parent处理框架的显示。”是啥意思啊?不太明白啊。那个接收字符串后怎么显示在另一个iframe里面啊
      

  5.   

    我想在action.php中处理后让$strRight显示在showResult.php页面中。也就是显示右边的iframe中,我该如何实现啊!?在action.php的处理问题的链接所在frame或者iframe加个target=    showResult.php所在iframe例子:<FRAMESET border=0 frameSpacing=0 rows="90, *" cols="1020" frameBorder=0>
     <FRAME name=header src="header.php" frameBorder=0 noResize scrolling=no/>
     <FRAMESET cols="172, *">
      <FRAME name=menu src="menus.php" frameBorder=0 noResize/>
      <FRAME name=main src="main.php" frameBorder=0 noResize scrolling=yes/>
     </FRAMESET>
    </FRAMESET>这种框架结构的话
    在menus.php里可以<a class="sub_menu" href="user.php" target=main><span>-</span>&nbsp;系统用户</a>
    点了以后就在main框架里显示user.php
    如果要加动作处理,那么带上action=......还种法子是用jquery替换掉默认链接行为,自己处理交互请求,不过这个比较复杂.
      

  6.   

    最简单是用 target 属性啊。。
      

  7.   


    我是在action中进行处理,然后处理完了以后显示在另一个iframe中,你提供的方法貌似不行吗?也有可能是我没有能理解。大哥你能说说我的代码怎么改进吗?谢谢
      

  8.   


    能详细点吗?谢谢,我感觉实现不了我那个效果,处理前后分别显示在不同的iframe中。
      

  9.   

    给你一段iframe的操作事例:
    <html>
    <body><iframe src="http://microsoft.com"></iframe>
    <iframe src="http://google.com"></iframe>
    <iframe src="http://youtube.com"></iframe><script type="text/javascript">
    for (var i=0; i<frames.length; i++){
      frames[i].location="http://w3schools.com"
    }
    </script></body>
    </html>windows.parent指向上一层的浏览器窗口,frame.getElementById可以获取具体某个frame中的网页元素。
      

  10.   

    <td align="center" width="50%"><iframe
                src="1.php" height="650" name="left"
                frameborder="0" width="100%" scrolling="no" align="middle"></iframe></td>
            <td align="center" width="45%"><iframe src="showResult.php" height="650"
                name="right" frameborder="0" width="100%" scrolling="no"
                align="left"></iframe></td>
    两个框架的name不要一样了。1.php:<form action="action.php" method="post" target="right">
    <table align="center">
        <tr>
            <td><input type="text" name="str" /></td>
            <td><input type="submit" name="submit" value="submit"/></td>
        </tr>
    </table>
    </form>
      

  11.   

    从1.php到action.php你是没问题的,能做到。OK~在action.php里有值了
    用Session吧
    先在所有的<php下面加 session_start();然后在action.php里写以下代码
    $_SESSION["strRight"] = $strRight;这样就在showResult.php中可以使用$_SESSION["strRight"]了,这个就是你要传的值
    比如可以这么写:
    <?php
    session_start();
    echo $_SESSION["strRight"];
    ?>
      

  12.   


    我测试了下!用target="right"只会打开一个新窗口,不会在right iframe中显示的。谢谢!
      

  13.   


    用session的话要每次刷新整个页面才会有用,否则在第二次提交的时候右边的iframe中显示出来的值是不变的!谢谢!