widget.js
/** Helper function to load external css  */
Helper function to load external css
Helper function to load external css
function loadCss(href, onLoad) {
    var link_tag = document.createElement('link');
        link_tag.setAttribute('type', 'text/css');
        link_tag.setAttribute('rel', 'stylesheet');
        link_tag.setAttribute('href', href);
    if (link_tag.readyState) {
      link_tag.onreadystatechange = function () {
        if (this.readyState == 'complete' || this.readyState == 'loaded') {
          onLoad();
        }
      };
    } else {
      link_tag.onload = onLoad;
    }
    (document.getElementsByTagName('head')[0] || document.documentElement).appendChild(link_tag);
  }
function loadCss ( href , onLoad ) { var link_tag = document . createElement ( 'link' ) ; link_tag . setAttribute ( 'type' , 'text/css' ) ; link_tag . setAttribute ( 'rel' , 'stylesheet' ) ; link_tag . setAttribute ( 'href' , href ) ; if ( link_tag . readyState ) { link_tag . onreadystatechange = function ( ) { if ( this . readyState == 'complete' || this . readyState == 'loaded' ) { onLoad ( ) ; } } ; } else { link_tag . onload = onLoad ; } ( document . getElementsByTagName ( 'head' ) [ 0 ] || document . documentElement ) . appendChild ( link_tag ) ; }
Helper function to load external css
Helper function to load external css
// append loaded style sheet to head