Toran Billups Toran Billups - 1 year ago 66
jQuery Question

Does jQuery have a built in function to return the rootURL?

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 ...

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 + "/";

Answer Source

What about

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download