Tuesday, 28 June 2011

Dynamically add an additional css file thourgh javascript code


function IncludeCSS(cssFilePath)
{
      var v_css  = document.createElement('link');
      v_css.rel = 'stylesheet'
      v_css.type = 'text/css';
      v_css.href = cssFilePath;
      document.getElementsByTagName('head')[0].appendChild(v_css);
}

IncludeCSS("http://localhost:1702/ServiceApp/CSS/xyz.css");

No comments:

Post a Comment