title: How to compare two urls in javascript or jquery
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4140324/parse-url-with-javascript">Parse URL with Javascript</a>  </p>
  </blockquote>
  
  
  
  <p>I want to compare the basic part of the URL. If I've entered <code>www.websitename.com</code> it should say duplicate if I enter </p>
  
  <pre class="lang-html prettyprint-override"><code>http://www.websitename.com
  https://www.websitename.com
  websitename.com
  http://www.websitename.com/filename
  subdomain.websitename.com etc.. 
  </code></pre>
  
  <p>How can I do it?</p>