O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

escapeString — Perform URL escaping on a string

Usage

URL.escapeString(str)

str : String

Description

Returns a new string in which certain characters in str have been replaced with escape sequences of the form % hh, where hh is two hex digits giving the ASCII code for the value.

Returns invalid if str can’t be converted to a string or contains characters from outside the US-ASCII character set.

Example

URL.escapeString("/foo.cgi?foo=1&bar=2")

returns string "%2Ffoo.cgi%3Ffoo%3D1%26bar%3D2"

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required