07.20.08

Dynamically load javascript code in page

Posted in General Javascript | at 2:56 am by admin

In the IWebBiz CMS individual content objects may need their own javascript code to process them. So I load each individual javascript file as needed. The code to do this is:-

function dhtmlLoadScript(url)
{
   var e = document.createElement("script");
   e.src = url;
   e.type="text/javascript";
   document.getElementsByTagName("head")[0].appendChild(e);
}

Leave a Comment

You must be logged in to post a comment.