Add Elements to DOM

  • Embedded Gallery2 is not available.
  • Embedded Gallery2 is not available.

Completely untested.

function includeJSsd(script_filename,ElId)
{
   return includeNewElement(document.getElementById(ElId), 'script',
      {   
          'type'    : 'text/javascript',
           'language': 'javascript',
           'src'     : imageCachePath + script_filename
      }
   );
}

function includeNewElement(el, myType, prams)
{
   var html_head = document.getElementsByTagName('head').item(0);
   var myNode = document.createElement(myType);
   var node;
   for(node in prams)
   {
      myNode.setAttribute(node ,prams[node]);
   }
   if(el == null)
  {
     html_head.appendChild(myNode);
   }
   else
   {
     el.appendChild(myNode);
   }
   return myNode;
}