JS get the site root path (site and virtual directory), get the root of the Web site or the root address of the virtual directory
function Getrootpath () {
var strfullpath=window.document.location.href;
var strpath=window.document.location.pathname;
var pos=strfullpath.indexof (strpath);
var prepath=strfullpath.substring (0,pos);
var postpath=strpath.substring (0,STRPATH.SUBSTR (1). IndexOf ('/') +1);
return (Prepath+postpath);
}
*/
JS get the site root path (site and virtual directory), get the root of the Web site or the root address of the virtual directory
function Getrootpath () {
var pathName = window.location.pathname.substring (1);
var WebName = PathName = = "? ': pathname.substring (0, Pathname.indexof ('/'));
return Window.location.protocol + '//' + Window.location.host + '/' + webName + '/';
return Window.location.protocol + '//' + Window.location.host + '/' + webName;
}