As the title says, will this code work and will it work in major browsers?
I ask because currently I have no resources to test it, so I would appreciate some help on this.
Here is what I have (not tested):
setTimeout(window.location.history.go(-2), 5000);
Thanks
historyis a property ofwindow, notlocation. Also if you want it to trigger after a delay you will need to make a delayed-call function—currently you are callinggo()immediately, and passing the return value of the function tosetTimeout, which clearly won’t work. You probably mean:As for ‘go back two pages’, yes, it’ll work in pretty much all JS-supporting browsers, but it’s the kind of thing users are likely to find incredibly confusing. Are you sure you want to do that?