Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to dynamically call css path in head section of an html page
  2. function addCSS() {
  3.         var headtg = document.getElementsByTagName('head')[0];
  4.         if (!headtg) {
  5.             return;
  6.         }
  7.         var linktg = document.createElement('link');
  8.         linktg.type = 'text/css';
  9.         linktg.rel = 'stylesheet';
  10.         linktg.href = 'CSS/RoundCorners.css';
  11.         linktg.title = 'Rounded Corners';
  12.         headtg.appendChild(linktg);
  13.     }