标签:
//获取网站虚拟目录名称
function GetVirtualDirectoryName() {
var pathname = location.pathname;
var pos = pathname.indexOf(‘/‘);
return pathname.substr(0, pos);
}
//获取网站标头
//绝对路径的时候使用
function GetHeader() {
var host = location.host;
var dirName = GetVirtualDirectoryName();
return "http://" + host + "/" + dirName;
}
标签:
原文地址:http://www.cnblogs.com/Dylanblogs/p/4377591.html