Novice learning front-end--javascript Foundation

Source: Internet
Author: User

Having studied CSS-related knowledge, I have some basic knowledge of front-end engineers. But to better grasp the front-end, you must learn good javascript knowledge.

The following will be interpreted from the perspective of basic syntax, variables, keywords, reserved words, statements, functions, BOMs, and so on.

First, the basic grammar

Javacript as an object-oriented, script-level lightweight language, with Java same strain.

Naming: Case sensitive, weak type definitions (typically Var, unrestricted type).

The end-of-line semicolon is optional (from experience, recommended writing, can improve the quality of code reading).

Parentheses are used for code snippets.

Note with C, Java type, single line with "//", segment Comment with "/**/".

Second, the variable

Declare the variable with the Var type.

Third, the data type

JavaScript has a total of 9 data types. are: undefined (undefined), null (NULL), Boolean, String, number, Object, Reference, List, completion.

The declaration of the array, var v_array = new Array (10);

can also, var v_array = new Array (0,1,2,4);

Iv. Basic Statements

Like other languages, JavaScript is also divided into sequential statements, conditional statements, and circular statements.

Definition and use of functions

The basic syntax for defining a function is as follows:

Function name (arg0,arg1,... ArgN)

{}

Vi. other objects

Date type data object, Math Math object. They all have some common methods and properties.

Vii. BOM Basis

The BOM is the abbreviation for the Brower Object model. They are the object of the browser and have interaction with the browser.

(1) Window object. is the browser's window. usually have Moveby (), MoveTo (), Resizeby (), Resizeto () and other common methods. Window's alert (), confirm (), prompt () and other methods are also more common.

(2) Document object. The most common is the write () method

(3) Location object. Used primarily to set the URL address.

(4) Navigator object. The main access to the browser information.

(5) Screen object. The main access to screen information.

Now that you've only learned the basics of JavaScript, the next blog will discuss the advanced knowledge of JavaScript.


This article is from the "on the road to Chasing Dreams" blog, please be sure to keep this source http://wangyu19900123.blog.51cto.com/6190851/1543340

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.