include external javascript file in another javascript file





Referencing another js file in an external js file HiIm trying to do something simple all I need to do is to reference another javascript file inside a javascript file. Is there an "include" statement that I can use.Many thanks no , but you can write document.write Home Forums > Development > Programming > JavaScript >.Now, can I include or enter my other .js files into mainScript.js file instead of listing them on test.html? If you want to include a JS file in a JS you can use jQuery for that.var imported document.createElement(script) imported.src /path/to/imported/ script document.head.appendChild(imported) This blog is explain how to include a javascript file in another js file or we can include script file in html and also in head tag by help of jquery and JS.A