中文(简体)
- // 获取当前文件名 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; }