AJax技术

JavaScript技巧:JS刷新父页面

字号+ 作者:H5之家 来源:H5之家 2016-01-15 08:35 我要评论( )

非模态刷新父页面:window.opener.location.reload(); 模态刷新父页面:window.dialogArguments.location.reload(); Response.Write(script language=jav

非模态刷新父页面:window.opener.location.reload(); 模态刷新父页面:window.dialogArguments.location.reload(); Response.Write(script language=javascriptrn); Response.Write(!--rn); Response.Write(if(dialogArguments != null) {rn

 非模态刷新父页面:window.opener.location.reload();
   模态刷新父页面:window.dialogArguments.location.reload();
   Response.Write("<script language="javascript">rn");
   Response.Write("<!--rn");
   Response.Write("if(dialogArguments != null)   {rn");
   // 注意上面的dialogArguments,就是父页面showModalDialog()的第二个参数。
   // 就是父页面的window对象引用。
   Response.Write("dialogArguments.location.reload(true);rn");
   // 上面就是刷新父页的代码,相当于在父页上使用
   // window.location.reload(true);代码
   Response.Write("window.close();}"); // 关闭对话框
   Response.Write("//-->rn</script>"); //关闭脚本块
   }
   上面的代码就是关闭对话框和刷新父页的代码,这段代码也可以直接写入editdata.aspx的html中,然后在后台cs中调用

 

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • 网页注册表单的网页设计技巧

    网页注册表单的网页设计技巧

    2016-02-06 16:00

  • JavaScript学习总结之JS、AJAX应用

    JavaScript学习总结之JS、AJAX应用

    2016-02-06 15:02

  • ajax技巧制作得在线歌词搜索功效

    ajax技巧制作得在线歌词搜索功效

    2016-02-06 14:47

  • 学习JavaScript设计模式之代理模式

    学习JavaScript设计模式之代理模式

    2016-01-25 17:02

网友点评
o