Is there a way to embed one JavaScript file into another so that it can be referenced? I'm looking for the JavaScript equivalent of include()
in PHP.
Many people have suggested using this method:
document.write('<script type="text/javascript" src="globals.js"></script>');
However, I am unsure if this is similar to include()
.