What Is JavaScript?

JavaScript is Netscape's cross-platform, object-oriented scripting language. Core JavaScript contains a core set of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:

  • Client-side JavaScript extends the core language by supplying objects to control a browser (Navigator or another web browser) and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.
  • Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a relational database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.
JavaScript lets you create applications that run over the Internet. Client applications run in a browser, such as Netscape Navigator, and server applications run on a server, such as Netscape Enterprise Server. Using JavaScript, you can create dynamic HTML pages that process user input and maintain persistent data using special objects, files, and relational databases.

Through JavaScript's LiveConnect functionality, you can let Java and JavaScript code communicate with each other. From JavaScript, you can instantiate Java objects and access their public methods and fields. From Java, you can access JavaScript objects, properties, and methods. Netscape invented JavaScript, and JavaScript was first used in Netscape browsers.

pSources (The eSources below would have more current information.)
  • Flanagan, David. JavaScript: The Definitive Guide. Cambridge, MA: O'Reilly, 1998.
  • Heinle, Nick. Designing with JavaScript: Creating dynamic web pages. Cambridge, MA: O'Reilly, 1997.
  • Bradenbaugh, Jerry. JavaScript Application Cookbook. Cambrige, MA: O'Reilly, 1999.
eSources (This is a short list of eSources.)




JavaScript is a scripting language designed to add some interactivity to an HTML page. This means, for example, that a JavaScript can be initiated when you mouse over an area on the HTML page. The JavaScript could do several things such as show a new graphic, add to a counter, check some form values, and so on. These are JavaScript functions that run on the client machine. The JavaScripts are downloaded with the HTML page to the client machine and run there.

The <script></script> tags bound a JavaScript. A typical use looks like this:
	<html>
	
	<script language = "JavaScript">
	
	The script is listed here
	
	</script>
	
	</html>
	
An HTML page can have as many JavaScripts as you like. Strategy note: If there are scripts that should run before the rest of the page presents itself as HTML, then those scripts should be located in the head of the HTML document.

JavaScript Objects:

As a scripting or programming language, JavaScript has an "object" flavor. This means that an object such as the "document" (i.e., the HTML page you view) has certain properties and methods. Therefore to refer to the background color property of the HTML page, one could use document.bgColor. Similarly, to write something to the HTML from a JavaScript, one uses the document.write method.



Examples of JavaScript objects

JavaScript Functions:

Functions are a basic tool in JavaScript. A function may contain several JavaScript operations and may return a value. A function may be called many times by some HTML event such as a button press or an image mouse over.

Examples of JavaScript functions

JavaScript and Extensible Technologies

XML and XSL stylesheets

Document Object Model Overview

Choosing between SAX and DOM

IHTMLDOMNODE Interface

Dynamic HTML: Engineering JavaScripts with XML and the DOM.