Connecting Tech Pros Worldwide Forums | Help | Site Map

How do avoid IE alert

Member
 
Join Date: Jun 2008
Posts: 40
#1: Aug 27 '08
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 .

Member
 
Join Date: Jun 2008
Posts: 40
#2: Aug 27 '08

re: How do avoid IE alert


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();


}
Member
 
Join Date: Jun 2008
Posts: 40
#3: Aug 27 '08

re: How do avoid IE alert


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.
Member
 
Join Date: Jun 2008
Posts: 40
#4: Aug 27 '08

re: How do avoid IE alert


sorry i could not change post to get.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#5: Aug 27 '08

re: How do avoid IE alert


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).
Member
 
Join Date: Jun 2008
Posts: 40
#6: Aug 29 '08

re: How do avoid IE alert


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:-)
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#7: Aug 29 '08

re: How do avoid IE alert


Glad you got it working, though it should be more of a server-side solution rather than using JavaScript to set the iframe src.
Member
 
Join Date: Jun 2008
Posts: 40
#8: Sep 1 '08

re: How do avoid IE alert


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!
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#9: Sep 1 '08

re: How do avoid IE alert


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.
Member
 
Join Date: Jun 2008
Posts: 40
#10: Sep 18 '08

re: How do avoid IE alert


Thank you for the Advise :)
Reply