Force  a refrech

lobos
lobos used Ask the Experts™
on
Through javascript I am forcing a refresh of the page using window.location.reload()
But then this line is run, a confirmation window comes up.
"The page cannot be refreshed without resending the information. Click Retry to send the information again or click Cancel to return to the page that you were trying to view."
So the user has the option to refresh or cancel. Is there a way to force the refresh and not have alert box come up. I really don't want to see that prompt.
PLEASE HELP ASAP
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
try
document.location.href=document.location.href

regards,
Steve

Author

Commented:
That won't won't work, we have a generic asp file that does that all the work and we submit the data the same file over and over, using the code you put above actually redirects us back 2 pages and won't work....
Any other ideas?
it shouldn't redirect back, but should retrieve exactly same location as window.location.reload() above.  Could be that your browser is caching old data, so you might want to set Internet Options/Settings to 'Every visit to the page'
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
No it does not refresh the current page. It does redirect back.
Touching the settings here is not an option.......
Any other ideas or comments?
Did you try use top.location.reload()?

Author

Commented:
Still get the prompt. :(
SGC

Commented:

The reason you are getting that dialog is because you are POSTing to the page in question. This is a security feature of your browser. If you change your form method to GET, you wont have that problem, although the URL will contain all of the data from the form.

I'm not terribly familiar with ASP, but you may need to modify the way the ASP script accesses the data passed to it. For example, in PHP, you retrieve said data with a $_GET["parameterName"] or with $_POST["parameterName"], while with AOLserver you can simply use ns_queryget, which doesnt care what method is used.

Hope that helps.

Commented:
You could store your ASP POST variables that you want to keep in a session.  Then do a GET.

You could also retrieve the data you want to change with a seperate request.  Depending on your browser target type you can change the src of a javascript to something that sets new variables... do a get to a seperate frame that relays the data back to the main frame... or whatever.

I may have some code for some of this if you would like.

Author

Commented:
This is as good as it gets I guess.
Problem was not solved but this is was the best solution.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial