JavaScript Learning Notes (ii) features of JavaScript

Source: Internet
Author: User

。。 For Web pages, JavaScript everywhere, for the poor English people it is simply a nightmare of existence, but the form of forced to start learning today! I hope I can stick to it.
From where to start, my goal is from the Think big, from the application focus, not the details, anyway the details can not remember, to use when the key.
Although programming is a layman, it also accumulates some common sense, so start learning from the features of JavaScript.

First, what is JavaScript?
JavaScript is based on aObject(Object) andEventsDrive (Event driven) and has a relativeSecurityOfClient ScriptLanguage.
This definition is very good and almost covers the characteristics of JavaScript.

1. JavaScript is a scripting language
Script is a plain text saving program, the script is simply a strip of text commands, the script is executed, the need for an interpreter, the translation of its strips into machine-readable instructions, and according to the programOrderPerform. The interpreter for the JavaScript script is calledJavaScript interpreter,It is included in the browser, due to different types and versions of the browser, the explanation of the things also have a difference, in order to allow most browsers to explain the footsteps of our writing, currently we have to write different scripts for different browsers, so many times JavaScript is a long-winded.JavaScript is an explanatory language in order,It doesn't need to be compiled like C,java.
Cross-platform: JavaScript relies on the browser itself, JavaScript cross-platform, because the mainstream browser has a JavaScript interpreter.

2. Object-based
Based on objects, this is interesting, and there are still people talking about whether JavaScript is an object-oriented language because it has no class (class) in its syntax. Let's just think of it as a special object-oriented programming (OOP) language,in JavaScript,Objects are everywhere, almost everything is objects, strings, numbers, arrays, functions, dates, boolean,regexp (regular expressions), and Null is also an object.objects are data that have properties and methods。 Is it convenient for built-in objects to use their properties and methods directly?

3.EventsDriven
The interaction between JavaScript and HTML is implemented through events, and when we interact with certain types of Web pages in the browser (such as clicking a button and hovering over the mouse), the event occurs. Events occur on the DOM and are an important part of the DOM, and by using JavaScript, you can listen to the occurrence of specific events (DOM events) and provide a response to those events.

4. Relative safety
JavaScript is not allowed to access the local hard disk, and the data cannot be stored in the server, the network documents are not allowed to be modified and deleted, only through the browser for information browsing or dynamic interaction. So as to effectively prevent the loss of data or illegal access to the system.

Two. What JavaScript can do
JavaScript is used by millions of of web pages to change styles, validate forms, detect browsers, create cookies, make web effects (such as floating, scrolling, sliding doors, etc.), perpetual calendar, online editor, JS Games, Data interaction with the server (AJAX) ...

Third, three components of JavaScript
core (ECMAScript)
Strong style= "LINE-HEIGHT:28PX;" > Document Object Model (DOM)
Browser object Model (BOM)

ECMAScript describes the following:

    • Grammar
    • Type
    • Statement
    • Key words
    • Reserved words
    • Operator
    • Object

ECMAScript is just a description that defines all the properties, methods, and objects of the scripting language

The DOM (Document Object model) is an application interface (API) for HTML and XML. The DOM will plan the entire page into a document composed of node hierarchies. Each part of an HTML or XML page is a derivative of a node. The DOM creates a tree to represent the document, giving developers unprecedented control over the content and structure of the document. The DOM API makes it easy to delete, add, and replace nodes.

Browser object Model (BOM)

The BOM mainly deals with browser windows and frames, but usually browser-specific JavaScript extensions are considered part of the BOM. These extensions include:

    • Pop up a new browser window
    • Move, close, and resize a browser window
    • Anchor object that provides details about the Web browser
    • Screen object that provides detailed information about the user's screen resolution
    • Support for Cookies
    • IE expands the BOM, joins the ActiveXObject class, and can instantiate ActiveX objects through JavaScript

Because there is no relevant BOM standard, each browser has its own BOM implementation.

JavaScript Learning Notes (ii) features of 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.