Getting Started with JavaScript

Source: Internet
Author: User

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.

例:varnum = 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

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.