javascript - Load external js file in another js file -
i have file include in html , want call javascript. please suggest me how should it?
<script type="text/javascript" src="js.js">/* old:123 new: 456*/ </script>
i want include in js file, not in html.
if want include js file in js can use jquery that
$.getscript('another_file.js', function() { //script loaded , executed put dependent js here });
and if cannot use jquery
var imported = document.createelement('script'); imported.src = '/path/to/imported/script'; document.head.appendchild(imported);
Comments
Post a Comment