1.php页面代码:<?
  setcookie("js",$js+1);
?><html>
<script>
function opens(id)
{
window.showModalDialog("2.php?id="+id);
if(returnValue==2){
window.location.reload();
}
}
</script>
<body>
<a href="javascript:;" onclick="opens(1)"><font color="red">链接一</font></a>
<br><br>
页面计数器,看是否刷新:
<?echo$js;?>
</body>
<html>==================================
2.php页面代码:
<html>
<body>
<script>returnValue=2;window.close();</script> </body>
<html>============================================如果弹出窗口2.php中returnValue=2,那么1.php中
if(returnValue==2){
window.location.reload();
}
就刷新1.php主窗口问题是怎么传递和接收returnValue
?请高手帮忙,谢谢!

解决方案 »

  1.   

    window.opener.location.href=window.opener.location.href;window.close();
      

  2.   

    window.showModalDialog 好象可以判断是否有返回值的吧     以前弄过时间长了不记得了
      

  3.   

     就定义个变量接收就行  var ret = window.showModalDialog....
      

  4.   

    在你要用showmodaldialog打开的网页的增加<body onunload=“freshParent()”>,然后在fleshparent函数中调用window.parent.document.execCommand('Refresh');
      

  5.   

    传递returnValue:
    在2.php中:window.returnValue=ids;接收returnValue:
    将1.php 中代码改成  var backValue = window.showModalDialog("2.php?id="+id);