Skip to content Skip to sidebar Skip to footer

How To Work History.back() In Ie8 And Above Versions

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 cli

Solution 1:

Here is a working example (tested on saucelabs IE7, IE8, IE9 @Windows XP and Vista)

<inputtype="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.

Solution 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;

Post a Comment for "How To Work History.back() In Ie8 And Above Versions"