How to conditionally include an external javascript file?
This question was asked earlier in Include a Javascript file in another Javascript file . This piece of code may match what you were looking for
function include(filename) { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.src = filename; script.type = 'text/javascript'; head.appendChild(script) } if this script does not work, I suggest you view and read the message above: Include the Javascript file in another Javascript file .
I hope this helps, maybe this is not the answer you were looking for, but it might just help.