code: function getHost(url) {
          var uri = window.document.createElement('a');
  
          if (isAbsolute(url) || startWithSlash(url)) {
  
              uri.href = url;
  
              return (uri.protocol || window.location.protocol) + '//' + (uri.host || window.location.host);
  
          }
      }
docs: /*
  Return the host of a given url. If the url is not fully absolute use the document domain. If the url is
  relative return undefined
  
  @param url the url to get the host part from
  @returns {string} the host part of the url