title: How to get base url with jquery or javascript?
body: <p>In joomla php there I can use <code>$this-&gt;baseurl</code> to get the base path, but I wanted to get the base path in jquery.</p>
  
  <p>The base path may be any of the following example:</p>
  
  <pre><code>http://www.example.com/
  http://localhost/example
  http://www.example.com/sub/example
  </code></pre>
  
  <p>The <code>example</code> may also change.</p>