title: How to extract the hostname portion of a URL in JavaScript
body: <p>Is there a really easy way to start from a full URL:</p>
  
  <pre><code>document.location.href = "http://aaa.bbb.ccc.com/asdf/asdf/sadf.aspx?blah"
  </code></pre>
  
  <p>And extract just the host part:</p>
  
  <pre><code>aaa.bbb.ccc.com
  </code></pre>
  
  <p>There's gotta be a JavaScript function that does this reliably, but I can't find it.</p>