title: How-to get the Application path using javascript
body: <p>If I have my application hosted in a directory. The application path is the directory name.</p>
  
  <p>For example</p>
  
  <p><code>http://192.168.1.2/AppName/some.html</code></p>
  
  <p>How to get using javascript the application name like in my case <code>/AppName</code>.</p>
  
  <p><code>document.domain</code> is returning the hostname and <code>document.URL</code> is returning the whole Url.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thr app path could be more complex, like <code>/one/two/thre/</code></p>