Category:XULRunner - MDC, Categories - MDC, Build:Text Preprocessor - MDC, View source - Edit - MDC, Category:All Categories - MDC, Recent changes - MDC, DOM Inspector - MDC, Pit Bull, Login required to edit - Edit - MDC, Login required to edit - Edit - MDC

DOM:window.escape

From MDC

(Difference between revisions)
Revision as of 22:23, 7 July 2006
Nickolay (Talk | contribs)

� Previous diff
Current revision
Nickolay (Talk | contribs)

Line 10: Line 10:
== Example == == Example ==
-alert(escape("http://www.cnn.com")); // displays: http%3A//www.cnn.com+ alert(escape("<nowiki>http://www.cnn.com</nowiki>")); // displays: http%3A//www.cnn.com
==Notes == ==Notes ==

Current revision

« Gecko DOM Reference

Contents

[edit]

Summary

Encodes a string, replacing certain characters with a hexadecimal escape sequence.

[edit]

Syntax

escaped = escape(regular);
  • escaped is the encoded string.
  • regular is 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.

Retrieved from "http://developer.mozilla.org/en/docs/DOM:window.escape"