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)