The role of JavaScript, JS Common Three kinds of dialog box; = = and = = = difference; function internal parameter array arguments to print arguments inside the function; JS Error: No block-level scope

Source: Internet
Author: User

JS: Client (browser) scripting language weak type based on prototype event driver does not need to compile (run directly) The role of JS : Form verification, reduce the pressure on the service sideAdd a page animation effectdynamically change page content       Ajax Network Requests (a) Common dialog boxes Alert () Dialog: This method is a method of the Window object that pops a dialog box in the browser (the method has no return value)

prompt () dialog box:2 parameters, one is the browser prompt information, the second is the default input box value, the return value is the input box information

confirm () Dialog: Pop up a dialog box in the browser, the user can only select correct or cancel, the return value corresponds to TRUE or false

Note: These three methods are all methods of the Window object, which can be used directly to get the information entered by the user through a dialog box.

(b) the difference between = = and = = =

First say = =: Determine whether the content is the same, the same return true, otherwise return false

say = =: First judge whether the content is the same, in determining whether the data type of 2 variables is the same

(c) function internal array arguments:

First, the array can only be used inside the function, to hold the actual arguments, as an item of the array, see an example below:

Operating effect:

Arguments.callee is a pointer to the function itself, typically used for function recursion

(iv) Local variables and global variables

Global variables: Acting on the whole scope

Local variables: defined in functions, used in function fields

Note: There is no concept of block-level scope in JS, which is illustrated by the following code:

Operating effect:

in JS, because it is a scripting language, very flexible, and high-level language is not the same, there is no block-level scope, if in Java, I is not defined

The role of JavaScript, JS Common Three kinds of dialog box; = = and = = = difference; function internal parameter array arguments to print arguments inside the function; JS Error: No block-level scope

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.