Javascript does not have any implied "include this other file" mechanisms, such as css @include. You just need to list your globals file before the logical file in tags:
<script type="text/javascript" src="globals.js" /> <script type="text/javascript" src="logic.js" />
If you guarantee that globals are available before anything in the logical file works, you can do a slow polling cycle to find out if any particular variable is available before calling the init () function or any other function.
Marc b
source share