unrlencode using javascript

unrlencode using javascript

escape(string)

The function escape() in javascript do the same work
as urlencode() do in PHP

All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. For example, a space is returned as “%20.”
This function is convenient when encoding a string to be used in a query part of an URL, as a convenient way to pass variables to the next page.

encodeURI() do the reverse process ie,
The Original string can be obtained by passing the result of escape()
to encodeURI()

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.