What is JavaScript?
JavaScript is a scripting language based on the Java programming language.
It is designed for use within web pages (client-side) or on web servers (server-side).
This tutorial will deal only with client-side JavaScript, code that is embedded within
the HTML of a web page and executed by the browser.
The language allows a designer to access elements within a web page such as images, form
elements, links, etc. These objects can then be manipulated or changed programmatically.
JavaScript also allows you to capture events, such as mouse clicks or key strokes. This
gives you the ability to perform actions based on user input.
Some common examples of using JavaScript include mouse rollovers, form validation and
animation. It can also be used for navigation aids, such as the menu at left which lets you
jump to various parts of this tutorial or search box below which lets you find words or phrases
in the current page.
What Browsers Support JavaScript?
Netscape first introduced JavaScript in Navigator version 2. Microsoft added some support
with Internet Explorer version 3. Likewise, other browsers have added support in varying degrees.
Just as new versions of browsers add and extend to HTML, JavaScript has been updated and extended
to support it.
Compatibility among different browsers and versions is always an issue. Later, we will see how
to deal with these differences, but for now we will concentrate on the most popular features.
Unless otherwise noted, the examples used in this article will all work with Netscape Navigator
or Microsoft Internet Explorer version 3 or later browsers.
The JavaScript Tutorial
The following sections cover the basics of using JavaScript on a webpage. If you're new to
JavaScript, try going through them in order. If you're more familiar with the language you
can skip to the more advanced topics.
- Covers the basics of
JavaScript including how to add it to your page and syntax. Some simple examples are given along
with descriptions of how they work.
- Includes some background on
object oriented programming and describes the objects found in JavaScript.
- Covers using JavaScript with
multiple windows and frames and creating new windows.
- Goes deeper into using and manipulating form
data and objects.
- Gives examples of using creating new objects,
using cookies, event capturing, regular expressions and dynamic HTML.
- Links to online references and code examples.
|