devote / HTML5-History-API

HTML5 History API expansion for browsers not supporting pushState, replaceState
http://spb-piksel.ru
MIT License
1.02k stars 182 forks source link

history.location.pathname behavior not consistent between HTML5 and HTML4 fallback #77

Open luhn opened 8 years ago

luhn commented 8 years ago

The base URL is the current page in the HTML5 implementation (as per the spec), but the domain root in HTML4 implementation.

For example, running this fiddle in Chrome 45 yields the expected output.

* /luhn/auth3x5q/show/
* /luhn/auth3x5q/show/rel/at/ive

But run it on IE9, and you get much different output:

* /
* /rel/at/ive

Changing the basepath resolves this inconsistencies.

luhn commented 8 years ago

Actually, changing the basepath then breaks absolute URLs.

devote commented 8 years ago

basePath works similar HTML-element BASE. But I will think about your problem.

luhn commented 8 years ago

<base> only affects relative URLs, so the behavior shown in the last fiddle I linked is inconsistent with it.

devote commented 8 years ago

<base> only affects relative URLs

Yes, you're absolutely right


I will think over this problem, when there will be free time. Thanks!

P.S. If you know how to fix, I'll be happy to consider your decision.