javascript - Embed js file in another -
how embed following inside js file
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
you can not embed javascript file in another. can load more javascript files in dynamically function such one.
function loadjs(file) { // grab head element var head = document.getelementsbytagname('head')[0]; // create script element var script = document.createelement('script'); // set type script.type = 'text/javascript'; // set source file script.src = file; // add script element head head.appendchild(script); }
Comments
Post a Comment