Tuesday, May 8, 2007

How to refresh parent window after closing child or popup window in both IE7 & FF after round trip to the server with javascript?

I've searched the web for a while to achieve following:
a. user clicks delete button for blog entry.
b. a popup window appears and confirms to delete.
c. a user clicks yes in the window.
d. round trip to the server to delete the blog.
e. refresh the parent window
f. close the popup window.

However, I couldn't find and good solution. Most of site mentions window.opener.location.reload() or window.opener.location.href = sUrl.

All those things may work in client side only. However, my case involves a round trip to the server to delete the blog entry.

So far, I know that I can use window.opener.location.reload(true/false) will work on client side, and it's not feasible for the server side processing.

Well, there was my mistake to choose a right event handler.
I chose onsubmit() instead of onunload().

Because of it, my parent page refreshed before data got updated. So I thought that it was refreshed.

lol.