Ricardo Garcia wrote:
hi, how could i import a js file in another js file???
what i want is the equivalent to:
<script type="text/javascript" src="file.js"></script>
in html
If you are creating an HTML page, you don't need to
explicity import JavaScript files, just put a reference
to the files containing the functions you want to use:
<script type="text/javascript" src="file01.js"></script>
<script type="text/javascript" src="file02.js"></script>
...
<script type="text/javascript" src="filenn.js"></script>
Just call functions in the files, you can add as many
as you like. Functions from one file can use functions
in another file quite happily.
If you are using some other scripting environment
(e.g. Mozilla's Rhino), you may require some other method.
Cheers, Rob.