JavaScript Advanced Program Design reading notes (a) Introduction to JavaScript

Source: Internet
Author: User

Chapter One: Introduction to JavaScript

JavaScript developed by Netscape Navigator

the implementation of Javascript has three parts :

1. core (ECMAScript): provides core language capabilities.

2. Document Object Model (DOM): Provides methods and interfaces for accessing and manipulating Web page content.

3. Browser Object Model (BOM): Provides methods and interfaces for interacting with the browser.

A Web browser is just one of the possible hosting environments implemented by ECMASCRIPR.

Five major Web browsers (ie,firefox,safari,chrome and Opera)

Chapter Two: using JavaScript in HTML

<script> is very similar to > that its src attribute can point to the current HTML in a domain other than the one in which the page resides URL .

<script> The location of the label :

1. the js file contained in the <head> element must wait until all js Code is downloaded, parsed, and executed. To start rendering the contents of the page (< content within body>)

2. put in < Body > elements, placed behind the content of the page, you can render the content first.

Deferred script: The script is deferred until the entire page has been parsed and then run.

<script type= "Text/javascript" defer= "defer" src= "Example.js"/>

It is best to place the deferred script at the bottom of the page.

Asynchronous script: the page is not allowed to wait for several scripts to download and execute, thus asynchronously loading the page for additional content. For this reason, it is recommended that asynchronous scripts do not modify the DOM during loading.

<script type= "Text/javascript" async= "async" src= "Example.js"/>

The introduction of JS Code, recommend the use of external files, maintainability, cacheable, adapt to the future .

JavaScript Advanced Program Design reading notes (a) Introduction to JavaScript

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.