Friday 23 January 2015

Dynamically Load JS/CSS using Javascript Function:

Dynamically Load JS/CSS using Javascript Function:
-----------------------------------------------------------------

<input type="button" onclick="helper()" value="Helper">

   <script language="JavaScript">
   function helper()
   {
      var head= document.getElementsByTagName('head')[0];
      var script= document.createElement('script');
      script.type= 'text/javascript';
      script.src= 'helper.js';
      head.appendChild(script);
   }
   </script>

No comments:

Post a Comment