devote/HTML5-History-API

# being appended twice in IE8

Closed this issue · 4 comments

I have a page:
http://www.mysite.com/page.html

And some tabs with href="#link" that are to be appended to the main URL.

In all modern browsers they are being correctly appended like this:
http://www.mysite.com/page.html#link

But in IE8 these are being appended to the window URL like this:
http://www.mysite.com/page.html#/#link

Any idea why?

Hi,

This is the correct behavior of the library. Since the first hash (#) is
needed for the proper operation of the history-api, the second hash (#) is
added for the proper operation of the simple hash-references.

Use history.location instead window.location that would get the right hash
value for using in JavaScript

2014-06-10 10:44 GMT+04:00 simondib notifications@github.com:

I have a page:
http://www.mysite.com/page.html

And some tabs with href="#link" that are to be appended to the main URL.

In all modern browsers they are being correctly appended like this:
http://www.mysite.com/page.html#link

But in IE8 these are being appended to the window URL like this:
http://www.mysite.com/page.html#/#link

Any idea why?


Reply to this email directly or view it on GitHub
#58.

So http://www.mysite.com/page.html#/#link is the correct URL in IE8? If so, this is going to give odd results in site tracking reports.

FYI I'm getting the hash from the tab's onclick through $(this).attr('href').

So http://www.mysite.com/page.html#/#link is the correct URL in IE8?

Yes, if you use hash links in page.

this is going to give odd results in site tracking reports.

Reports use the browser address bar?

I was curious if Google Analytics' event tracking would relay the URL from the browser location.history?

Thanks for the prompt replies in any case. Great library!