Click to See Complete Forum and Search --> : Can I include a JavaScript file in another ??


Salam
12-09-2003, 01:53 AM
Hi, is there somthing like an include in Javascript. Can I do something inside a JavaScript file (file.js) like this:

include "another_file.js";

If yes, what is the command and syntax

Thanks,
Salam

terov
12-09-2003, 02:12 AM
Try something along these lines:
document.write("<script src='otherscript.js'><\/script>");
at the end of your script.

Check out this thread (http://forums.devshed.com/t54554/s.html) on devshed forums.

Good luck!

Salam
12-09-2003, 08:38 AM
Thank you very much ... worked as needed :)

Salam