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.
Written by Lars Jung
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Browser
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#