Changes

Understanding JavaScript Functions

1 byte removed, 14:30, 15 April 2009
no edit summary
== Where to Place Function Declarations ==
There are two recommended locations to place function declarations. These are either within the ''<head>'' section of the HTML document from which they will be called, or within a .js include file that is included in the ''<head>''. The preferred location is in the .js file since this provides the mosty most flexibility in terms of making the functions available in other pages.
Further, the objective in writing functions is to make them as general as possible in order to maximize re-use. Be sure to take a little time when designing functions to consider how you might make the function useful in the future, not just for the current requirement.