Search code examples
javascriptbrowser-history

Is `history.go` case-insensitive


In javascript is the history.go method case-insensitive when it comes to going to a url. As in if the actual url is Login.html and I passed in login.html would it go to Login.html if it was in history?

I read on w3schools:

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

The parameter can either be a number which goes to the URL within the specific position (-1 goes back one page, 1 goes forward one page), or a string. The string must be a partial or full URL, and the function will go to the first URL that matches the string.

But then on MDN they have no info on this functionality with go

https://developer.mozilla.org/en/docs/DOM/Manipulating_the_browser_history#Moving_to_a_specific_point_in_history

You can use the go() method to load a specific page from session history, identified by its relative position to the current page (with the current page being, of course, relative index 0).

So does history.go(url) even work? or do I need to use history.go(number)


If the case is that it is case sensitive then would it be possible to make it case-insensitive (which is probably a no)


EDIT

IE appears to be the only browser to support passing a url to it, going by elclanrs answer.

So lets divert the question a bit. Is there any way I could do this? Or create this kind of functionality?


Solution

  • Also from the MDN on history.go(integerDelta):

    Loads a page from the session history... Calling go() without parameters or with a non-integer argument has no effect (unlike Internet Explorer, which supports string URLs as the argument).

    So I suppose that's the important bit you missed.