LESSON 1
Overview
In this class, you will learn what the JavaScript language is, how it can be used, look at useful examples, and the essentials to give you a solid understanding of the JavaScript language.
Audience for this Class
This class is considered a beginner" level class, therefore, I will assume no knowledge of any type of programming skill. I will assume you have some basic understanding of HTML/XHTML. You do need to know HTML/XHTML to take this class, but it would be helpful in your learning because all the coding examples are used within HTML pages (.html).
If you need a little extra help with learning XHTML please let me know and I will explain any code that is used in the lessons and examples. LVS has a Build Your Website series that teaches XHTML and CSS.
Tools Needed
There is no specific tool to develop in JavaScript so you can use any free text or web editor like Notepad++ or HTML-Kit or Komodo Edit or commercial products like Adobe Dreamweaver or Microsoft Web Expression.
History of JavaScript
Brendan Eich, who started working for Netscape in 1995, began developing a scripting language called LiveScript for the release of Netscape Navigator 2 in late 1995, with the intention of using it both in the browser and on the server (where it was to be called LiveWire). Netscape entered into a development alliance with Sun Microsystems to complete the implementation of LiveScript in time for release.
A complete JavaScript implementation is made up of the following three distinct parts:
1. The Core language (ECMAScript)
2. The Document Object Model (DOM)
3. The Browser Object Model (BOM)
ECMAScript
ECMAScript, the language defined in ECMA - 262, isn't tied to web browsers. In fact, the language has no methods for input or output whatsoever. ECMA - 262 defines this language as a base upon which more - robust scripting languages may be built. Web browsers are just one host environment in which an ECMAScript implementation may exist. A host environment provides the base implementation of ECMAScript as well as extensions to the language designed to interface with the environment itself.
ECMAScript is simply a description of a language implementing all of the facets ascribed in the specification. Other scripting languages such as ActionScript 3.0 for Adobe Flash are based on ECMAScript.
The five major web browsers (Internet Explorer, Firefox, Safari, Chrome, and Opera) all
comply with the third edition of ECMA - 262.
The Document Object Model (DOM)
The Document Object Model (DOM) is an application programming interface (API) for XML that was extended for use in HTML. The DOM maps out an entire page as a hierarchy of nodes. Each part of an HTML or XML page is a type of a node containing different kinds of data.
By creating a tree to represent a document, the DOM allows developers an unprecedented level of control over its content and structure. Nodes can be removed, added, replaced, and modified easily by using the DOM API.
With the DOM, developers can alter the appearance and content of a web page without reloading it (i.e. the beginning of Ajax).
Continued...