IE7 Warning on document.location.reload()!  
Author Message
Chilá





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

Hi all,

I'm using the document.location.reload() javascript method to refresh my page after some works.

When I do that, IE7 shows me an alert, telling: "Internet Explorer needs to resend the information you've previously submitted".

Is there a way to avoid this warning this web application will run on the local Intranet and all PCs are Internet Explorer based!

Chila!




Internet Explorer Development4  
 
 
EricLaw-MSFT





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

This warning will appear if the user got to the current page via HTTP POST. If you don't want this behavior, just reassign window.location instead of calling reload.
 
 
osman ayhan





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

I really do not understand anything from your response.

I have got the same problem

I am using this lkine to resfresh the parent from child page;

window.opener.location.reload();

And i want to avoid to get the same warning/error message...

MAy u please write your solution suggestion clearly

THank in advance...

Osman AYHAN


 
 
Debra Elliott





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

I also encounter this error--only in IE 6. The beauty of using the reload() method is that you can use it when you have child forms open that update data in the underlying database. When that child window closes, I call opener.location.reload(true) to reload the original form and get fresh data (that might have changed as a result of opening the child form page, etc.) I don't have to pass along in HTTP headers what the name or URL is of the parent page with this method. Therefore, as I see it, there is a valid reason to use this method and it would be nice if there was a way to suppress the warning in IE. So, is there another way to suppress this warning...it makes all the users of my app think there is an error, when there is not an error--in fact, everything is functioning as designed.


 
 
osman ayhan





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

Yes...

Same message and worries....

Waiting for an answer to this questions..

How can i enforce to IE 7.0 to not to show this warning message

I do not want to discard to use the method of Reloading Parent page by Child Page.

Thanx in advance...


 
 
Willz





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

Why not dynamically update the parent page with the new data

window.opener.document.getElementById(myid) (etc.)

or

window.opener.updateMe(feedback);

where updateMe() is a function in the parent page.

depends on exactly what you are trying to achieve, but it suits my purposes better than a reload.

Will


 
 
Brandnew





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

I think this answer couldn't be clearer. It means that to reach the page you are in (the one that gives you the problem) you submitted some information via POST - for example by a <form method="POST"> - .

The solution is to replace document.location.reload() with window.location = "current_page.html" where current_page.html is the current page. (or using php, it would be window.location = "< php echo $PHP_SELF >").
Hope it's useful..


 
 
Debra Elliott





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

Unfortunately, you've oversimplified it. The URL of the parent page is not known due to the parameters that may have been passed into it. The only way with your method that I can do what you've suggested is to somehow keep track of the original url (including any http parameters passed in.) That is not something I want to code in. I'd like to keep everything very compartmentalized--it's easier to support. I like the idea of call the javascript method in the parent page--the parent page can keep track of its own stuff and I plan to investigate whether or not this is a viable solution.
 
 
Oakman





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

The guy asked a relatively simple question - if you don't know the answer, don't tell him to try something different


 
 
ML-Spinner





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

// create a fairly random number
var t=Math.floor(Math.random()*1000000);
// set location to what it is plus &rn=<the random number>
onclick="window.location=window.location+'&rn='+t;

Should solve your problem, I belive

 
 
Matt Olson





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

You don't need to know the URL of the parent. With this simple trick in javascript:

window.opener.location.href = window.opener.location.href;


 
 
X-Sol





PostPosted: Internet Explorer Web Development, IE7 Warning on document.location.reload()! Top

It's very simple if you are not a lazy reject who doesn't know how to think. Oh sorry that was rude...

If you need this to work without the message:

document.location.href = document.location.href + document.forms[0].hiddenFieldIputMyPostVarsInInQueryStringFormat.value;

Mommy I'm stupid and it's Microsofts fault!