Appendix D. JavaScript Global Functions

Several global functions are also available to your programs. Most of these involve parsing strings for some purpose, and several of them are for preparing strings for use as URIs. See Chapter 6: The Global and Object Objects for more explanation of these functions.

Table D.1. List of Methods

Method Name

Support

Description

decodeURI()

CH1+, FF1+, IE5.5+, NN4+, O3+, SF1+

Returns the unencoded value of an encoded Uniform Resource Identifier (URI) string.

decodeURIComponent()

CH1+, FF1+, IE5.5+, NN4+, O3+, SF1+

Returns the unencoded value of an encoded component of a Uniform Resource Identifier (URI) string.

encodeURI()

CH1+, FF1+, IE5.5+, NN4+, O3+, SF1+

Encodes a text string to a valid Uniform Resource Identifier (URI) by encoding reserved characters.

encodeURIComponent()

CH1+, FF1+, IE5.5+, NN4+, O3+, SF1+

Encodes a text string to a valid component of a Uniform Resource Identifier (URI) by encoding reserved characters.

escape()

CH1+, FF1+, IE3+, NN2+, O3+, SF1+

Encodes a string by replacing all special or reserved characters with their encoded equivalents. escape() is not Unicode-safe.

eval()

CH1+, FF1+, IE3+, NN2+, O3+, SF1+

Evaluates JavaScript source code and then executes it.

isFinite()

CH1+, FF1+, IE4+, NN4+, O3+, SF1+

Returns a Boolean value indicating if the supplied number is finite.

isNaN()

CH1+, FF1+, IE3+, NN2+, O3+, SF1+

Determines if the passed value will be treated as a number or not.

parseFloat()

CH1+, FF1+, IE3+, NN2+, O3+, SF1+

Returns a floating point ...

Get JavaScript® Programmer's Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.