title: Does jQuery have a built in function to return the rootURL?
body: <p>I typically use the below function to return the root URL if I ever need this, but thought to ask if jQuery had a "one liner" way to do this ...</p>
  
  <pre><code>function getRootURL()
          {
              var baseURL = location.href;
              var rootURL = baseURL.substring(0, baseURL.indexOf('/', 7));
  
              // if the root url is localhost, don't add the directory as cassani doesn't use it
              if (baseURL.indexOf('localhost') == -1)
              {
                  return rootURL + "/AppName/";
              } else {
                  return rootURL + "/";
              }
          }
  </code></pre>