HTTP POST must be encoded and windows.location is encoded

When using JavaScript window.location in your code, be aware, that window.location is encoded using JavaScript escape function. It is not always obvious because characters, that get encoded / decoded using escape() / unescape() is rare in urls. Use the following syntax to get human readable url:
unescape(window.location)

URL: http://example.com/test url/
window.location: http://example.com/test%20url/
unescape(window.location): http://example.com/test url/

Also, HTTP POST must be percent encoded, using ‘+’ instead of ‘%20′:
w3
Percent encoding

This entry was posted in Web and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>