How to get the http://www.blbah.com part of the url in javascript?
<p>My url on a page is like:</p>

<pre><code>http://www.example.com/dir1/file.html?a=1
</code></pre>

<p>I need to extract:</p>

<pre><code>http://www.example.com
</code></pre>

<p>how can I do this in javascript?</p>
