Wednesday, June 8, 2011

Import a .js file in another js file

function inc(filename)
{
var body = document.getElementsByTagName('head')[0];
script = document.createElement('script');
script.src = filename;
script.type = 'text/javascript';
body.appendChild(script);
}

inc("jscripts/HelpWindow.js");
inc("jscripts/shortcut.js");

No comments:

Post a Comment