Saturday, October 11, 2008

escaping javascript

Javascript provides
escape(string)
method but it does not escapes the following chars:
* @ - _ + . /

Use encodeURIComponent(URIstring)instead. The encodeURIComponent method encodes all characters.
Use the decodeURIComponent() function to decode URIs encoded with encodeURIComponent().

No comments: