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