function pageName() {
var strUrl = location.href;
var arrUrl = strUrl.split("/");
var strPage = arrUrl[arrUrl.length - 1];
if (strPage.indexOf("?") >= 0)
{
strPage = strPage.split(‘?‘)[0];
}
return ReplaceAll(strPage, "#", "");
}
function ReplaceAll(str, sptr, sptr1)
{
while (str.indexOf(sptr) >= 0) {
str = str.replace(sptr, sptr1);
}
return str;
}
时间: 2024-10-28 18:03:04