JavaScript Summary (1)

Source: Internet
Author: User
Tags script tag

In millions of internet pages, JavaScript is used to improve design, validate forms, detect browsing
Create cookies, etc. JavaScript is the most popular scripting language on the Internet and can be used in all major
Browser, such as Internet Explorer, Mozilla, Firefox, Netscape, and opera.

JavaScript is an object-and event-driven (driven) and has security
Scripting languages that are available. The purpose of this language is to work with HTML Hypertext Markup Language, Java Applet (Java

Small program) together enables you to link multiple objects in a single Web page, interacting with web customers to
Development of client applications and so on.

JavaScript code is a text character format that can be embedded directly into an HTML document and can be moved
State load.

JavaScript uses " "to identify the meaning of the script"

Save the script content as a single file, assuming the name is "1.js", and then set the src of a script tag
property to point to the file. The syntax is as follows:

The Type property of the script block scripts tag indicates the language in which the script is used.

In a lot of books and online examples
, use the Language property to indicate the language of the script, such as:

When embedding JavaScript scripts within HTML pages, it is not allowed in the code.
Now the word "". The following code is wrong:
");

This is because when the browser loads the HTML and tries to explain it, it will assume that the first occurrence of the ""Is where the script ends, which creates a syntax error. The solution is also very simple,
Take the "" string apart.

JavaScript constants, also known as literal constants, are information that is solidified in the program code. The main function of a variable is
Access data, providing a container for users to access information. For variables, you must understand the names of variables,
types, declarations, and scopes.

an explicit declaration. Use the keyword "var" declaration.

An implicit declaration. Declaration by assignment Operator "="

Variable name = 22;
Variable name = "This is a string";

There are four basic data types in javascript: Integer, String, Boolean, and null . Because
JavaScript is a weakly typed language, so a variable or constant does not have to declare its type first, but instead uses or assigns
Determines the type of its data when the value is

intn=1;//Decimal
intn=03;//Octal: Arabic numerals starting with 0
intn=0x22;//16 Binary: Arabic numerals starting with 0x

JavaScript Summary (1)

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.