Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old August 27th, 2008, 03:51 PM
Member
 
Join Date: Jun 2008
Posts: 36
Default 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 .
Reply
  #2  
Old August 27th, 2008, 03:56 PM
Member
 
Join Date: Jun 2008
Posts: 36
Default

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


}
Reply
  #3  
Old August 27th, 2008, 04:29 PM
Member
 
Join Date: Jun 2008
Posts: 36
Default

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.
Reply
  #4  
Old August 27th, 2008, 04:29 PM
Member
 
Join Date: Jun 2008
Posts: 36
Default

sorry i could not change post to get.
Reply
  #5  
Old August 27th, 2008, 04:49 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,964
Default

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).
Reply
  #6  
Old August 29th, 2008, 12:17 PM
Member
 
Join Date: Jun 2008
Posts: 36
Default

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:-)
Reply
  #7  
Old August 29th, 2008, 04:04 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,964
Default

Glad you got it working, though it should be more of a server-side solution rather than using JavaScript to set the iframe src.
Reply
  #8  
Old September 1st, 2008, 08:10 AM
Member
 
Join Date: Jun 2008
Posts: 36
Default

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!
Reply
  #9  
Old September 1st, 2008, 08:51 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,964
Default

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.
Reply
  #10  
Old September 18th, 2008, 03:47 PM
Member
 
Join Date: Jun 2008
Posts: 36
Default

Thank you for the Advise :)
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

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.