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); 

source


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -