Introduction to JavaScript

Source: Internet
Author: User
Tags define function

In the HTML position has three blocks: 1.head inside 2.body inside 3.

3 common dialog boxes

Alert () Warning dialog box, which is the function of a warning dialog to pop up.

Confirm () Determines the dialog box, the function is to pop up a selection of OK dialog box, after clicking OK, it returns True, click Cancel to return flase, available variables to accept.

The prompt () function pops up a dialog box that allows you to enter content.

JavaScript syntax

JavaScript: There is only one variable type, var. Data type: Integer, Decimal, String, Boolean

1. How to turn a numeric string into a digital type:
parseint ("string")--turns the string into an integral type
Parsefloat ("string")--turns the string into a decimal number
2. How can I tell if a variable is a number?
var a = IsNaN (b);

True is not a number

False is a number

Array new Array (); its length is dynamically variable, it can be placed in any type of element.

Sorted array: A.sort (); Sort by first character, A.reverse (); Flip Array.

Function

Define function functions Add (formal parameter) {function Body}, functions name Add, input as parameter, return value can be var type or return value.

Function not called does not execute, call of function: Add (argument)

DOM Operations

-blank is a new window open

-slef is its own window open

Introduction to JavaScript

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.