DOM:window.escape
From MDC
« Gecko DOM Reference
Contents |
[edit]
Summary
Encodes a string, replacing certain characters with a hexadecimal escape sequence.
[edit]
Syntax
escaped = escape(regular);
escapedis the encoded string.regularis a regular string.
[edit]
Example
alert(escape("http://www.cnn.com")); // displays: http%3A//www.cnn.com
[edit]
Notes
The escape() method converts special characters (any characters that are not regular text or numbers) into hexadecimal characters, which is especially necessary for setting the values of cookies. Also useful when passing name=value pairs in the URL of a GET request, or an AJAX GET/POST request.
[edit]
Specification
DOM Level 0. Not part of any standard. Mentioned in a non-normative section of ECMA-262.
Categories: Gecko DOM Reference | DOM 0