Category:Tools - MDC, mozIStorageService - MDC, Toolkit API - History - MDC, Gecko Plugin API Reference - MDC, MDC:Getting started - MDC, Medical Malpractice Insurance, DOM:window.setInterval - MDC, Login required to edit - Edit - MDC, DOM:window.escape - MDC, Login required to edit - Edit - MDC

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);
  • 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"