Overview
Enables additional javascript files to be included in your script.Syntax
include(filename);
Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
filename | String | The name of the file to include. If it's in a different folder, include the relative path? |
Return value
Oh the joy...
Value | Type | Description |
---|---|---|
undefined | Undefined | The file was successfully included. Note: |
false | Boolean | There was a problem including the file. |
Note: The include() function traps any uncaught errors and writes them to the log files, then returns false. So you don't need to wrap this function in a "try ... catch
" clause.
Example
Including a file
include("foo.js"); // include foo.js