现在的位置: 首页 > 综合 > 正文

如何使得 弹出对话框不关闭但也能刷新他的父窗口

2012年02月08日 ⁄ 综合 ⁄ 共 985字 ⁄ 字号 评论关闭

问:
在1.htm中:
window.showModalDialog("2.htm","","center: Yes; help: No; resizable: No; status: No;menubar:no;toolbar:yes");

而2.htm不关闭,点一按钮而触发1.htm刷新!!
______________________________________________________________________________________________
答1:
在1.html中
<body name="abc">//加入name属性;
在2.html中:
<input type=button onclick="javascript:document.abc.href='1.html';" value="刷新">
//注意:2.html一定要是1.html中弹出来的。
______________________________________________________________________________________________
答2:
还有问题
   1.html的源代码:
  <Script Language="JavaScript">
 function aa()
 {
  window.showModalDialog("2.htm","","center: Yes; help: No; resizable: No; status: No;");
 }
</Script>
<HTML>
 <BODY name="abc">
  <Form name="this_form">
   <Input type="button" name="this_button" onClick="aa();">
  </Form>
 </BODY>
</HTML>   
--------------------------------------------------------------------  2.html源代码:

  <HTML>
 <BODY>
  <Form name="this_form">
   <input type=button onclick="javascript:document.abc.href='1.html';" value="刷新">

  </Form>
 </BODY>
</HTML> 

抱歉!评论已关闭.