title: How to get base domain from the URL in JavaScript
body: <p>I would like to extract the base domain from the url in javascript.
  For example for the list of urls listed below I need to get <strong>google.com</strong> (or <strong>google.co.in</strong> as the case may be) as the result. </p>
  
  <p>www.google.com<br>
  www.google.co.in<br>
  www.images.google.com <br>
  www.images.google.co.in<br> 
  google.com<br>
  google.co.in<br>
  images.google.com <br>
  images.google.co.in<br></p>
  
  <p>Any one got some idea on how to do it. There is no direct method to find the base url in javascript i guess.</p>