 | 
August 27th, 2008, 03:51 PM
| | Member | | Join Date: Jun 2008
Posts: 36
| | How do avoid IE alert
i am trying refresh the iframe, ie browser
gives me the below alert.
The page can not be refreshed with out resending the information.click retry to send the information again or click Cancel to return to the page that you were trying to view.
i am expecting your valuble comments on
why am i getting this warning.and
how to avoid this warning.
Please help me .
| 
August 27th, 2008, 03:56 PM
| | Member | | Join Date: Jun 2008
Posts: 36
| |
The below shown is the code that i am trying to refresh the iframe.
for(i=0; (a = document.getElementsByTagName("iframe")[i]); i++)
{
a.contentWindow.location.reload();
}
| 
August 27th, 2008, 04:29 PM
| | Member | | Join Date: Jun 2008
Posts: 36
| |
I am in situvation where i could not change any of my get to post method, with out changing get to post, is there any way to avoid this alert.
| 
August 27th, 2008, 04:29 PM
| | Member | | Join Date: Jun 2008
Posts: 36
| |
sorry i could not change post to get.
| 
August 27th, 2008, 04:49 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
This alert popup appears because you've posted something and then you're refreshing the page. This will cause the form to be re-submitted. This may be unwanted, e.g. if you've just made a payment. To avoid this, use Post/Redirect/Get (PRG).
| 
August 29th, 2008, 12:17 PM
| | Member | | Join Date: Jun 2008
Posts: 36
| |
Hi All
Thanks for the reply Acoder. The link given was helpful.
i have solved the above problem, using the below code.
for(i=0; (a = document.getElementsByTagName("iframe")[i]); i++)
{
a.src=a.src;
}
Happy to be a member of this forum:-)
| 
August 29th, 2008, 04:04 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
Glad you got it working, though it should be more of a server-side solution rather than using JavaScript to set the iframe src.
| 
September 1st, 2008, 08:10 AM
| | Member | | Join Date: Jun 2008
Posts: 36
| |
oh...what's wrong with this solution?
will it fail in any case?I am not aware of the impact of this solution i just tried it
Please Advise!
| 
September 1st, 2008, 08:51 AM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
I'm not sure if it will cause a problem or not, just that I didn't have that in mind. If you look at the link(s), the solution is server-side, so after the post request is accepted, the page redirects using the location header to a different page using a GET request. I'm assuming the reason why your solution works is that you were posting to the same page rather than a different action page.
| 
September 18th, 2008, 03:47 PM
| | Member | | Join Date: Jun 2008
Posts: 36
| |
Thank you for the Advise :)
|  | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,248 network members.
|