Including other files

From Yate Documentation
Revision as of 19:52, 6 February 2013 by Paulc (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Because the standard Javascript language does not have the notion of a script file we added some extensions to include a script file from another one.

Syntax

#include "file1.js"
#require "file2.js"

IMPORTANT: There's no semicolon at end, these are not Javascript instructions.

The #require form prevents repeated inclusion of same file. This is the preferred form unless you have special requirements.

The #include form includes the specified file unconditionally.

Limitations

Since the inclusion is performed at parsing time the file name must be a string literal, it cannot be a variable.

File inclusion cannot occur inside an instruction or function.

See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers