• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part III: Appendixes > Functions

Functions

Before you can work with Dreamweaver extensions, you need to know about more than variables. You must also know your way around JavaScript functions. This includes defining functions, using function calls, adding parameters to your functions, and returning values from functions.

Functions and Function Calls

When code statements are placed inside a <script> tag, they are executed as soon as the tag loads. A more powerful and efficient way to write JavaScript code is to put the statements inside functions. A function is like a recipe for action. It contains all the script statements that need to be executed, but it won’t be executed until it’s called by a function call statement. Functions are usually placed inside <script> tags in the <head> of an HTML document. Function call statements can be placed anywhere, but are often placed in the <body> section, attached to page elements like text links or form buttons and set to execute when certain events take place, like when the user clicks on or mouses over the page element.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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