title: Get root website url in javascript for redirect
body: <p>I want to redirect to Login page from every page in my website after session timeout.
  I try to set window.location to the login page:</p>
  
  <pre><code>var ParentUrl = encodeURIComponent(window.parent.location.href);
  document.location.href = "~/Login.appx?ReturnUrl=" + ParentUrl;
  </code></pre>
  
  <p>but "~" seems to be unsupported.
  my Login page is located under my root folder.</p>
  
  <p>for example:
  *<em>http://server/website/</em>*Login.aspx</p>
  
  <p>How can I get this url in javascript?</p>
  
  <p>Thanks a lot,</p>
  
  <p>Inbal.</p>