How do avoid IE alert

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Revathi Balakrishnan
    New Member
    • Jun 2008
    • 40

    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.cli ck 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 .
  • Revathi Balakrishnan
    New Member
    • Jun 2008
    • 40

    #2
    The below shown is the code that i am trying to refresh the iframe.

    for(i=0; (a = document.getEle mentsByTagName( "iframe")[i]); i++)
    {

    a.contentWindow .location.reloa d();


    }

    Comment

    • Revathi Balakrishnan
      New Member
      • Jun 2008
      • 40

      #3
      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.

      Comment

      • Revathi Balakrishnan
        New Member
        • Jun 2008
        • 40

        #4
        sorry i could not change post to get.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          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).

          Comment

          • Revathi Balakrishnan
            New Member
            • Jun 2008
            • 40

            #6
            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.getEle mentsByTagName( "iframe")[i]); i++)
            {

            a.src=a.src;


            }

            Happy to be a member of this forum:-)

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Glad you got it working, though it should be more of a server-side solution rather than using JavaScript to set the iframe src.

              Comment

              • Revathi Balakrishnan
                New Member
                • Jun 2008
                • 40

                #8
                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!

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  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.

                  Comment

                  • Revathi Balakrishnan
                    New Member
                    • Jun 2008
                    • 40

                    #10
                    Thank you for the Advise :)

                    Comment

                    Working...