title: jQuery/JS: Get current URL parent directory
body: <p>From:</p>
  
  <blockquote>
    <p><a href="http://www.site.com/example/index.html" rel="noreferrer">http://www.site.com/example/index.html</a></p>
  </blockquote>
  
  <p>How can I get just:</p>
  
  <blockquote>
    <p><a href="http://www.site.com/example/" rel="noreferrer">http://www.site.com/example/</a></p>
  </blockquote>
  
  <p>And storing it into a variable using Javascript and how using jQuery also. Thanks in advance.</p>