Common functions of javascript
(1)AlertFunction: displays a warning dialog box, including an OK button.
(2)ConfirmFunction: A confirmation dialog box is displayed, including the OK and Cancel buttons.
(3)EscapeFunction: converts a character to a Unicode code.
(4)EvalFunction: calculates the result of an expression.
eval("x=10;y=20;document.write(x*y)"); document.write(eval("2+2")); var x=10; document.write(eval(x+17));The eval function can execute strings as javascript code, but this method is very violent and will affect the efficiency of javascript code. It is best to avoid using
(5)IsNaNFunction: test whether (true) No (false) is not a number.
(6)ParseFloatFunction: converts a string to a numeric value.
(7)ParseIntFunction: converts a string to an integer (number of digits can be specified ).
(8)PromptFunction: displays an input dialog box, prompting you to wait for user input. For example:
<Scriptlanguage = "javascript"> alert ("input error"); prompt ("enter your name", "name"); // (title, default value) confirm ("OK no! "); </Script>
(9)UnescapeFunction: decodes characters encoded by the escape function.
(10)IsFinite(Number) checks whether a value can be a finite number and returns True or False
(11)IsNaN(String) checks whether a value is not a finite number.
(12)DecodeURI() Is the encoded URI address decoding
(13)DecodeURIComponent() Is decoded by the encoded URI component.
(14)EncodeURI() Encrypt the string as URI
(15)EncodeURIComponent() Encode the string as a URI component