History.go ('url')

I saw that the history.go () method can have two types of parameter:

cm.

 http://www.w3schools.com/jsref/met_his_go.asp

But url does not work at all.

I use the JavaScript browser console to test this method, but have not succeeded.

I know that there are security issues, that you cannot read history records. You can just go back and forth.

So why is this string parameter specified in all js links?

+3
source share
3 answers

Providing a URL as a parameter is a non-standard function and will not work in all browsers. Most browsers only accept a relative number, for example. 1or -1.

MDC ( ):

[history.go(integerDelta)] , , -1 1 . integerDelta (, -1, ), . go() ( Internet Explorer, URL ).

, , W3Schools ; -)

+10

URL-, :

window.location.href="http://www.whereyouwannago.nl/";

URL-, ,

+2

MDC at least has this note:

Note. Internet Explorer supports passing string URLs as a parameter to go (); It is non-standard and not supported by Gecko.

I don’t know why it is indicated in many links.

+1
source

All Articles