棘手问题,我也不知道叫什么标题 本帖最后由 wujun_dry 于 2010-07-21 09:13:01 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不管是<a>还是<form>,都可以添加参数target。 我想在middle中显示$strLeft,在right中显示$strRight 用xmlhttp发送请求给action.php,然后接收返回的字符串,用JavaScript的document.parent处理框架的显示。 佐罗大哥,“用JavaScript的document.parent处理框架的显示。”是啥意思啊?不太明白啊。那个接收字符串后怎么显示在另一个iframe里面啊 我想在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> 系统用户</a>点了以后就在main框架里显示user.php如果要加动作处理,那么带上action=......还种法子是用jquery替换掉默认链接行为,自己处理交互请求,不过这个比较复杂. 最简单是用 target 属性啊。。 我是在action中进行处理,然后处理完了以后显示在另一个iframe中,你提供的方法貌似不行吗?也有可能是我没有能理解。大哥你能说说我的代码怎么改进吗?谢谢 能详细点吗?谢谢,我感觉实现不了我那个效果,处理前后分别显示在不同的iframe中。 给你一段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中的网页元素。 <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> 从1.php到action.php你是没问题的,能做到。OK~在action.php里有值了用Session吧先在所有的<php下面加 session_start();然后在action.php里写以下代码$_SESSION["strRight"] = $strRight;这样就在showResult.php中可以使用$_SESSION["strRight"]了,这个就是你要传的值比如可以这么写:<?phpsession_start();echo $_SESSION["strRight"];?> 我测试了下!用target="right"只会打开一个新窗口,不会在right iframe中显示的。谢谢! 用session的话要每次刷新整个页面才会有用,否则在第二次提交的时候右边的iframe中显示出来的值是不变的!谢谢! 求教!php的SoapClient问题,webservice的地址从ip地址改为域名后报错了 这两段在服务器执行的效率差别大不大???? 为何STATIC位置不同,结果产生了不同 关于google地图的问题 关于格式方面的问题 php数据库问题(在线等) php通过odbc如何访问vfp的dbf数据库 如何执行字符串中的php代码 有没有PHP解释器啊!?? 讨论有关文章系统的问题 出一道题,第一个答对的,送100分 require_once调用文件问题
<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> 系统用户</a>
点了以后就在main框架里显示user.php
如果要加动作处理,那么带上action=......还种法子是用jquery替换掉默认链接行为,自己处理交互请求,不过这个比较复杂.
我是在action中进行处理,然后处理完了以后显示在另一个iframe中,你提供的方法貌似不行吗?也有可能是我没有能理解。大哥你能说说我的代码怎么改进吗?谢谢
能详细点吗?谢谢,我感觉实现不了我那个效果,处理前后分别显示在不同的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中的网页元素。
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>
用Session吧
先在所有的<php下面加 session_start();然后在action.php里写以下代码
$_SESSION["strRight"] = $strRight;这样就在showResult.php中可以使用$_SESSION["strRight"]了,这个就是你要传的值
比如可以这么写:
<?php
session_start();
echo $_SESSION["strRight"];
?>
我测试了下!用target="right"只会打开一个新窗口,不会在right iframe中显示的。谢谢!
用session的话要每次刷新整个页面才会有用,否则在第二次提交的时候右边的iframe中显示出来的值是不变的!谢谢!