August 1999
Intermediate to advanced
1488 pages
72h 53m
English
escape(string) escape(expression)
The escape() method takes any string object or expression and returns a string object in which all non-alphanumeric characters are converted to their numeric equivalent in the form % XX. The XX is a hexadecimal number representing the non-alphanumeric character.
Listing 6.117 shows how to use the escape() method. It takes a string of text and returns the escaped value.
<script lanuguage="JavaScript">
var newString = escape("Tom & Jerry Show");
</script>
|
This returns: "Tom%20%26%20Jerry%20show". Notice that the spaces were replaced with "%20" ...
Read now
Unlock full access