js获取当前文件名
2010-08-08 20:14:36 来源:WEB开发网核心提示:// 获取当前文件名function getFileName(){var url = this.location.hrefvar pos = url.lastIndexOf("/");if(pos == -1){ pos = url.lastIndexOf("\\")}var f
// 获取当前文件名
function getFileName(){
var url = this.location.href
var pos = url.lastIndexOf("/");
if(pos == -1){
pos = url.lastIndexOf("\\")
}
var filename = url.substr(pos +1)
return filename;
}
function getFileName(){
var url = this.location.href
var pos = url.lastIndexOf("/");
if(pos == -1){
pos = url.lastIndexOf("\\")
}
var filename = url.substr(pos +1)
return filename;
}
[]
更多精彩
赞助商链接