脚本获取文件名

var pagename=location.href.replace(/^.+\/(.+)$/,'$1');

原文地址:https://www.cnblogs.com/zwei1121/p/1341551.html