...

View Full Version : window.location.reload(false);



crmpicco
07-07-2005, 11:29 AM
function refresh()
{
window.location.reload(false);
}

i have this function that i use on a onClick. is there anyway to bypass the preceeding 'retry' button
(a message box asking you if you want to send the information again. the "Retry" button) or automatically click it?

glenngv
07-07-2005, 11:36 AM
No. It happens because the page was the result of a POST submission. You can change the method to GET but that will show the submitted data in the URL.

martin_narg
07-07-2005, 11:55 AM
You can use this:


document.location.href = document.location.href;


However be warned of the pitfalls associated with it! The page will perform a "hard reload" so essentially it will be like viewing the page for the first time.

Using the reload() method is a "soft refresh" of the page, in that form input is saved/forms are reposted etc.

m_n

crmpicco
07-07-2005, 03:14 PM
var answer = confirm("You will be redirected to the Flight Search screen");
if(answer)
{
window.location="airbook.asp";
}
else
{
window.location="airbook.asp";
}


Is there a shorter way to code this?
Basically i want a confirm pop-up that will go to
airbook.asp no matter what button you click?

TIA.

Picco

martin_narg
07-07-2005, 05:20 PM
Why use confirm when the user is being directed anyway?


alert("You will be redirected to the Flight Search screen");
document.location = "airbook.asp";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum