11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Constructor<br />

This object cannot be instantiated because it defines the global context and thus has no<br />

constructor.<br />

Properties<br />

Infinity Constant holding the numeric value Infinity. (IE4+ (JScript 3.0+), N4.06+<br />

(<strong>JavaScript</strong> 1.3+), MOZ, ECMA Edition 1)<br />

NaN Constant holding the numeric value NaN (not a number). (IE4+ (JScript 3.0+),<br />

N4.06+ (<strong>JavaScript</strong> 1.3+), MOZ, ECMA Edition 1)<br />

undefined Constant holding the value undefined. (IE5.5+ (JScript 5.5+), N4.06+<br />

(<strong>JavaScript</strong> 1.3+), MOZ, ECMA Edition 1)<br />

Methods<br />

decodeURI(encodedURI) URI-decodes the string encodedURI and returns the<br />

decoded string. (IE5.5+ (JScript 5.5+), MOZ/N6+ (<strong>JavaScript</strong> 1.5+), ECMA Edition 3)<br />

decodeURIComponent(encodedURI) URI-decodes the string encodedURI and<br />

returns the decoded string. (IE5.5+ (JScript 5.5+), MOZ/N6+ (<strong>JavaScript</strong> 1.5+), ECMA<br />

Edition 3)<br />

encodeURI(uri) URI-encodes the string uri, treating uri as a full URI. Legal URI<br />

characters (for example, the :// after the protocol) are not encoded. Returns the<br />

encoded string. (IE5.5+ (JScript 5.5+), MOZ/N6+ (<strong>JavaScript</strong> 1.5+), ECMA Edition 3)<br />

encodeURIComponent(uriComponent) URI-encodes the string uriComponent and<br />

returns the encoded string. All potentially problematic characters (for example, / and ?)<br />

are encoded. (IE5.5+ (JScript 5.5+), MOZ/N6+ (<strong>JavaScript</strong> 1.5+), ECMA Edition 3)<br />

escape(string) URI-encodes string and returns the encoded string. Using the newer<br />

encodeURIComponent() is preferable. (IE3+ (JScript 1.0+), N2+ (<strong>JavaScript</strong> 1.0+),<br />

MOZ)<br />

eval(string) Executes string as <strong>JavaScript</strong>. (IE3+ (JScript 1.0+), N2+ (<strong>JavaScript</strong> 1.0+),<br />

MOZ, ECMA Edition 1)<br />

isFinite(value) Returns a Boolean indicating if the numeric argument value is finite.<br />

Returns false if value is NaN. (IE4+ (JScript 3.0+), N4.06+ (<strong>JavaScript</strong> 1.3+), MOZ,<br />

ECMA Edition 1)<br />

isNaN(value) Returns a Boolean indicating if the numeric argument value is NaN.<br />

(IE4+ (JScript 3.0+), N3+ (<strong>JavaScript</strong> 1.1+), MOZ, ECMA Edition 1)<br />

parseFloat(string) Parses string as a floating-point number and returns its value. If<br />

string cannot be converted, NaN is returned. (IE3+ (JScript 1.0+), N2+ (<strong>JavaScript</strong><br />

1.0+), MOZ, ECMA Edition 1)<br />

parseInt(string) Parses string as an integer and returns its value. If string cannot be<br />

converted, NaN is returned. (IE3+ (JScript 1.0+), N2+ (<strong>JavaScript</strong> 1.0+), MOZ, ECMA<br />

Edition 1)<br />

unescape(encodedString) URI-decodes encodedString and returns the decoded<br />

string. Using the newer decodeURIComponent() method is preferable. (IE3+ (JScript<br />

1.0+), MOZ, N2+ (<strong>JavaScript</strong> 1.0+))<br />

Support<br />

Supported in IE3+ (JScript 1.0+), N2+ (<strong>JavaScript</strong> 1.0+), Mozilla, ECMAScript Edition 1.<br />

head, HTMLHeadElement (Document Object)<br />

This object corresponds to the tag in the document. Access to this object is achieved<br />

through standard DOM methods, though since it typically does not have an id value it is often<br />

referenced by moving from a common starting point like document.documentElement.<br />

Properties<br />

This object has the following property, in addition to those in the Generic HTML Element<br />

object found at the beginning of this section:<br />

profile String containing a whitespace-separated list of URIs giving data properties and<br />

legal values. (IE6+, MOZ/N6+, DOM1)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!