问题
I'm facing a big issue related to "Back Button", Currently I am using JavaScript back button like - parent.history.back(); but it is giving error like "Webpage has expired" on clicking Back button. is there any solution to get rid of it. My Project is in Asp.net.Every comment is appreciated. Thank you..!
回答1:
Here is a working example (tested on saucelabs IE7, IE8, IE9 @Windows XP and Vista)
<input type="button" id="push-me" value="Push me!" onclick="window.history.back(); return false;"/>
If it still doesn't work for you may ensure that your tests are not executed within an iframe
but a separate window.
回答2:
It is probably a syntax error.
onclick="history.go(); return false;"
or
onclick="history.go(-1); return false;"
should work. Else you could try document referrer instead:
location.href = document.referrer;
来源:https://stackoverflow.com/questions/20561152/how-to-work-history-back-in-ie8-and-above-versions