## DFrameAPI: Include

Include a file

Demo

All demo files have an include statement. For instance this one:

file: onLoadDframe.html

Run the example
See the source code

### Syntax

DFrameAPI.include(fileNameAndPath[, option])

### Parameters

fileNameAndPath:

String. The full file name and path of the file to be included.

option

String.

§ 'A' if the file name and path is to be used as it

§ null (default) or omitted if the file name and path is relative to the global variable dFrameFilePath.

### Return value

no return value

### Usage

The include method is to be used before (and outside) the DFrameAPI.onLoad method so that the onLoad function will be launched after those includes are done

If the option parameter is set to 'A' the location of the file is used as it.

Example:

DFrameAPI.include('../../styles/blue/styleBlue.js', 'A') .

will load the '../../styles/blue/styleBlue.js' file.

If option is set to null (default) the total path of the file is dFrameFilePath + fullPathAndFileName.

Example:

dFrameFilePath = 'c:/Javascript/dFrame/

DFrameAPI.include('styles/blue/styleBlue.js') .

will load the ''c:/Javascript/dFrame/styles/blue/styleBlue.js' file.

Note that the dFrameFilePath MUST end with a '/' and so the fullPathAndFileName doesn't begin with it.

See also include in the tutorial.

Important note for developers using Netscape 4.x for tests:

This feature is not related to dFrameAPI but to a behavior of Netscape when a included file is not found: If the file specified with the include method is not found Netscape will produce the 404 - File not found error even after the path of the file has been corrected and the cache cleaned up. It is necessary to cleanup the cache, close Netscape and kill its process (not always done when Netscape is closed) before reloading the page.