Globalne odniesienie do JavaScript
Globalne właściwości i metody JavaScript mogą być używane ze wszystkimi obiektami JavaScript.
Globalne metody JavaScript
Function | Description |
---|---|
decodeURI() | Decodes a URI |
decodeURI Component() |
Decodes a URI component |
encodeURI() | Encodes a URI |
encodeURI Component() |
Encodes a URI component |
escape() | Deprecated. Use instead: encodeURI() encodeURIComponent() |
eval() | Evaluates a string and executes it as if it was script code |
isFinite() | Determines whether a value is a finite, legal number |
isNaN() | Determines whether a value is an illegal number |
Number() | Converts an object's value to a number |
parseFloat() | Parses a string and returns a floating point number |
parseInt() | Parses a string and returns an integer |
String() | Converts an object's value to a string |
unescape() | Deprecated. Use instead: decodeURI() decodeURIComponent() |
Globalne właściwości JavaScript
Property | Description |
---|---|
Infinity | A numeric value that represents positive/negative infinity |
NaN | "Not-a-Number" value |
undefined | Indicates that a variable has not been assigned a value |
Notatka
Ponieważ te metody są globalne, a globalnym obiektem jest okno przeglądarki, te metody są w rzeczywistości metodami okna:
isNaN() jest tym samym, co window.isNaN().