O'Reilly logo

JavaScript® Programmer's Reference by Alexei White

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

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 ...

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