Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript back and refresh

Status
Not open for further replies.

yuli1104

Programmer
Feb 20, 2002
60
CA
Hello everyone,
can somebody help with how to back to the previous page and refresh ?
currently I used window.history.back(1);
window.history.go(0);
but it doesn't work.
please note, I can't use document.location.href because the previous page is a dynamic url.
I can't set the previous asp page to be noCache because in some situation I need to cache the previous page. i.e, the scenario is a payment, when succussfully paid, the "back" button will do "back + refresh" so the client can see a refreshed account balance (That is what I am asking help for). if the payment is not successful, the "back" button will be a pure back button and keep all the existing user input. (that is why I need the cache)

Thanks

Yuli
 
Thank you bclt. but that window.history.go(-1); is equal to window.history.back(1);
It is just back with no refresh.
 
Disable the cache on the previous page, and create your own cache using cookies.

Adam

There are only 10 types of people in the world: Those who understand binary, and those who don't
 
Maybe this:

window.history.go(-1);
var sURL = unescape(window.location.pathname);
window.location.href = sURL;


// if even the page is cached this will force refresh ?
// Not tested

-bclt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top