Changes

Jump to: navigation, search

Understanding JavaScript Functions

644 bytes added, 19:01, 24 April 2007
Returning a Value from a Function
</html>
</pre>
 
== Where to Place Function Declarations ==
 
There are two recommended locations to place function declarations. These are either within the ''<head>'' of the HTML document 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 flexibility in terms of making the functions available in other pages.
 
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 can make this function useful in the future, not just for the current requirement.

Navigation menu