PATH: Instructional Server> COP 1830> Projects> Project 5>

COP 1830 - Example of a JavaScript Using Functions


Purpose:

This example is intended to assist students in understanding a technique for coding and executing scripts in which the script is coded as a function in the head section of the source code and executed via a form button. This technique differs from other examples that rely primarily on the use of "prompt dialog" boxes for input and HTML output using JavaScript write methods. Retrieve the web page at the address listed below and then view its source code to see how the form and JavaScript function were written. Give particular attention to the use of identifiers for form elements and JavaScript variables. Also examine how the identifiers are used to pass data between the form in the body section and the JavaScript function in the head section. The example JavaScript form is located at:

     http://www.gibsonr.com/classes/internet/examples/javascript/jsex_form_io.htm

In order to execute the JavaScript content of that document, you might have to reconfigure your browser's security settings as described on the page about Browser Security Configuration for Scripts.

PATH: Instructional Server> COP 1830> Projects> Project 5>