Friday, 23 January 2015

Load an External JavaScript file dynamically calling:

Load an External Javascript file dyanamically calling:
======================================================

<script>

var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript= document.createElement("script");
oScript.type = "text/javascript";
oScript.src="other.js";    // we can pass even folder level js files too. (i.e) foldernamee+"mainjs.js";
oHead.appendChild( oScript);

</script>


For Further Ref:
Thanks for Sharing :
http://ntt.cc/2008/02/10/4-ways-to-dynamically-load-external-javascriptwith-source.html

No comments:

Post a Comment

React Windowing or List virtualization - React App optimization

  Windowing  or   List virtualization   is a concept of only rendering or write the visible portion in the current   “ window ”   to the   D...