1. What can JavaScript do?
Give the page soul, so that the page can move, including dynamic data, dynamic tags, dynamic styles and so On. such as the implementation of the Carousel diagram, drag, magnifying glass, etc.
And the dynamic data is like not without JS page, the whole content is written on the page load onto the page, but to achieve a certain condition to load the required content, such as waterfall Flow picture, dynamic label
2. What is javascript?
JavaScript is a scripting language designed to interact with Web pages and consists of the following three different parts:
(1) ECMAScript: core;
(2) DOM: Document Object model;
(3) BOM: Browser Object Model.
3. How do I apply JavaScript to a Web page?
Method One: Insert the JavaScript code into the <script> tab of the HTML Document
Method two: store JavaScript code in a separate file
example: (1)<
head
>
<
script
type=“text/javascript”>
//javascript 代码
alert(‘hello world’);
</
script
>
</
head
>
(2)<
head
>
<
script
type=“text/javascript” src=“test.js”></
script
>
</
head
>
4. JavaScript-syntax
Variables are defined by the var operator plus the variable Name.
例:var
num = 1;
Variable name naming rules:
The first character must be a letter, an underscore (_), or a dollar sign ($);
The variable name cannot contain spaces or punctuation (except for underscores (_) and $);
Variable names are case-sensitive;
You cannot use reserved words or KEYWORDS.
A string consists of 0 or more characters, including letters, numbers, punctuation, and Spaces.
The string must be enclosed in quotation marks (single or double quotes).
example:var num = "mun"
Getting Started with JavaScript