HTML5-History-API icon indicating copy to clipboard operation
HTML5-History-API copied to clipboard

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

Open luhn opened this issue 9 years ago • 4 comments

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 avatar Sep 10 '15 00:09 luhn

Actually, changing the basepath then breaks absolute URLs.

luhn avatar Sep 10 '15 01:09 luhn

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

devote avatar Sep 10 '15 09:09 devote

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

luhn avatar Sep 10 '15 15:09 luhn

<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.

devote avatar Sep 10 '15 15:09 devote