public interface JSGlobalFunctions extends JSObjectFunctions
hasOwnProperty| Modifier and Type | Method and Description |
|---|---|
JSString |
decodeURI(JSString uri)
function decodeURI(uri) unescape characters in a URI.
|
JSString |
decodeURIComponent(JSString s)
function decodeURIComponent(s) unescape characters in a URI component.
|
JSString |
encodeURI(JSString uri)
function encodeURI(uri) escape characters in a URI.
|
JSString |
encodeURIComponent(JSString s)
function encodeURIComponent(s) escape characters in a URI Component.
|
JSString |
escape(JSString s)
function escape(s) encode a string.
|
JSObject |
eval(JSString code)
function eval(code) execute JavaScript from a string.
|
JSBoolean |
isFinite(JSNumber n)
function isFinite(n) determine whether a number is finite.
|
JSBoolean |
isNaN(JSNumber n)
function isNaN(n) check for not-a-number.
|
JSString |
parseFloat(JSString s)
function parseFloat(s) convert a string to a number.
|
JSString |
parseInt(JSString s,
JSNumber radix)
function parseInt(s, radix) convert a string to an integer.
|
JSString |
unescape(JSString s)
function unescape(s) decode an escaped string.
|
hasOwnProperty, isPrototypeOf, propertyIsEnumerable, toLocaleString, toString, valueOfJSString decodeURI(JSString uri)
uri - A string that contains an encoded URI or other text to be decoded.Global,
decodeURIComponent(),
encodeURI(),
encodeURIComponent(),
escape(),
unescape()JSString decodeURIComponent(JSString s)
s - A string that contains an encoded URI components or other text to be decoded.Global,
decodeURI(),
encodeURI(),
encodeURIComponent(),
escape(),
unescape()JSString encodeURI(JSString uri)
uri - A string that contains the URI or other text to be encoded.Global,
decodeURI(),
decodeURIComponent(),
encodeURIComponent(),
escape(),
unescape()JSString encodeURIComponent(JSString s)
s - A string that contains a portion of a URI or other text to be encoded.Global,
decodeURI(),
decodeURIComponent(),
encodeURI(),
escape(),
unescape()JSString escape(JSString s)
s - A string to be "escaped" or encoded.Global,
encodeURI(),
encodeURIComponent()JSObject eval(JSString code)
Example
eval("2+5"); //Returns 7
code - A string that contains the JavaScript expression to be evaluated or the statements to be executed.GlobalJSBoolean isFinite(JSNumber n)
n - The number to be tested.Global,
NaN,
Number.POSITIVE_INFINITYJSBoolean isNaN(JSNumber n)
Example
isNaN(0); // => false
isNaN(0/0); //=> true
isNaN(parseInt("3")); //=> false
isNaN(parseInt("hello")); //=> true
isNaN("3"); //=> false
isNaN("hello"); //=> true
isNaN(true); //=> false
isNaN(undefined); //=> true
n - The number to be tested.Global,
NaN,
Number.NaN,
parseFloat(),
parseInt()JSString parseFloat(JSString s)
s - The string to be parsed and converted to a numberGlobal,
isNan(),
parseInt()JSString parseInt(JSString s, JSNumber radix)
s - The string to be parsed and converted to an integerradix - An optional integer argument that represents the radix (i.e base) of the number to be parsed. If omitted or 0, the number is parsed in base 10.Global,
isNan(),
parseFloat()JSString unescape(JSString s)
s - A string to be "unescaped" or decoded.Global,
decodeURI(),
decodeURIComponent()