Last Updated: February 25, 2016
·
3.967K
· lrsjng

document.location.pathname not the same in all browsers

While Chrome and Firefox return the encoded pathname, Safari and Opera do return a decoded pathname.

For example "http://domain.tld/test%20url/" will become "/test%20url/" in Chrome etc. but "/test url/" in Safari.

Safari even decodes document.location.href, while none of the other three do.