Instructional Module X40c

JavaScript for the Web


to Top Overview

to Top

JavaScript™ is a programming language developed by Netscape, and supported in practically all browsers. This makes it ideal for adding a dynamic, interactive element to Web pages.

In addition to JavaScript, you may also see the language referred to as...

  • JScript™: Microsoft's variant of the language (re-named to avoid trademark infringement)
  • ECMAScript: The name used by ECMA (the European Computer Manufacturer's Association) in an attempt to arrive at a non-proprietary standard for the language.

JavaScript is a language primarily interpreted by the browser on the user's computer, though there is a server-side version as well.


to Top How JavaScript Works
Scripting

to Top
to Top

JavaScript usually consists of two parts:

  • Script: often in the <head> area, defining what the computer is supposed to do;
  • Invocation: in the <body> area, telling when the computer is supposed to do it.

However, JavaScript has a number of built-in functions that don't need to be scripted, and can simply be used. Here is an example of a simple, one-piece JavaScript script in the body of the HTML file, courtesy of JavaScript Source:

Code View

<SCRIPT>
document.write(Date()+".")
</SCRIPT>

 

Browser View

 


 
to Top JavaScript Resources
Resource List

to Top
to Top

There are many resources on the Web which offer help and pre-written scripts:

Exercise

to Top
to Top

Based on JavaScript library resources, create one or more Web pages with JavaScript to perform different tasks.

  • Each separate JavaScript task is worth 1/3 of the assignment value, so you should do at least 3.
  • If you do more than 3, you will earn extra credit up to 200% of the original assignment value.

to Top About This Document
Review Button

Click here for review questions.

Audience

to Top
to Top

This module is for people who are familiar with (X)HTML and CSS, and want to learn how to use JavaScript resources in their Web pages.

 

Objectives

On successful completion of this module, you will be able to:

  1. Recognize the purpose, advantages, and disadvantages of JavaScript;
  2. Find and use JavaScript resources on the Web;
  3. Add pre-written JavaScript to Web pages.
to Top
Module X40c: JavaScript for the Web
This document is part of a modular instruction series in Computer Instruction. For more information, see the overview or the list of modules in this series, X: XML, XHTML, DHTML, CSS. This document has been used in the following classes: INP 270.
History:
Original: 1 April 2003, by Laurence J. Krieg
Last modification: Monday, 31-Aug-2009 11:48:08 EDT
Copyright
Copyright © 2003, Laurence J. Krieg, Washtenaw Community College
Instructors: You may point to this file in your Web-based materials; however, its location may change without notice.
Students: You are welcome to make a copy for your personal use.
All other uses: Please contact the author, Laurence J. Krieg, for permission: krieg@ieee.org.

to Top