Problem with Close and Refresh function
Posted: Sun Dec 04, 2005 3:02 pm
Hi,
I have the following function which I use when popup windows are closed (that have been used to edit the data).
This function of course works a charm. Until of course the parent page was loaded with the post method and you get the annoying message asking if you want to post data again.
The following change to the function, seems to combat this:
Although, it would appear that if a page is loaded using the standard get method, it doesn't always do anything, more than likely due to browsers being a bit too clever.
What I'd like to do is develop a hybrid, something like the following:
Anyone have any ideas?
Cheers
I have the following function which I use when popup windows are closed (that have been used to edit the data).
Code: Select all
function CloseRefresh() {
window.opener.location.reload();
window.close();
}The following change to the function, seems to combat this:
Code: Select all
function CloseRefresh() {
window.opener.location=window.opener.location;
window.close();
}What I'd like to do is develop a hybrid, something like the following:
Code: Select all
function CloseRefresh() {
if (window.opener.requestmethod=='post') {
window.opener.location=window.opener.location;
} else {
window.opener.location.reload();
}
window.close();
}Cheers