Previous Example-|-Next Example-|-Return to Chapter Listing

Example 7.7:
Passing Values to Functions


The scripts in this Web page pass data to a function which then displays it in an Alert box.


These are the the scripts we used. First, in the HEAD: <SCRIPT LANGUAGE="JavaScript"> <!-- function function1(sText) { alert(sText) } //--> </SCRIPT> Later in the document the function is called with this script: <SCRIPT LANGUAGE="JavaScript"> <!-- function1("Text that is passed to the function") //--> </SCRIPT>
Previous Example-|-Next Example-|-Return to Chapter Listing