• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using a Function

After your function is defined, you'll eventually need to tell the browser to execute it, or call it. There are various ways to do this. The simplest way is to include in your script a statement consisting of only the function name, followed by parentheses (assuming for the moment that your function uses no arguments). Listing 4.1 provides an example (I've listed the entire page so you can see where the function goes).

Note

All the code listings in this chapter are available online from my Web site at the following address:

http://www.mcfedries.com/UsingJavaScript/



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint