I was wondering if there was a way to include a js file in another js file so that you can reference it. What I'm asking for is the JS equivalent of include()
in PHP.
I've seen a lot of people recommend this method as an example:
document.write('<script type="text/javascript" src="globals.js"></script>');
But I'm not sure if that's the same as include()