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

Example 7.3:
Defining Functions--Problem Fixed


This is for comparison with the previous example. The function is now called from a block of code that comes after the function has been defined... so now it works okay.

These are the scripts we used: <SCRIPT LANGUAGE="JavaScript"> <!-- function function1() { alert("This is function1 running.") } //--> </SCRIPT> <SCRIPT LANGUAGE="JavaScript"> <!-- function1() //--> </SCRIPT> </HEAD> <BODY> <BR>
Previous Example-|-Next Example-|-Return to Chapter Listing