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

Refresh parent window from child window without having to press the refresh button

2012年02月13日 ⁄ 综合 ⁄ 共 1695字 ⁄ 字号 评论关闭

Ref: http://www.dotnetjunkies.com/WebLog/dinakar/articles/12379.aspx

 

  • Heres a small piece of code to force refresh the parent window from the child window after closing the child window, without having to press the refresh button.
window.opener.location=window.opener.location; window.close();

response.write the above JS code in the child window.

for example:

response.write(”<Script> window.opener...........close();" & Chr(60) & "/script >")

  • If you want the user to manually refresh the page after closing the child window use

    window.opener.location.reload();window.close();

    in the above example.

  • If you just want to close the child window ( as in “cancel”) use window.close(); in the above example.

抱歉!评论已关闭.