var pagename=location.href.replace(/^.+\/(.+)$/,'$1'); 转载于:https://www.cnblogs.com/zwei1121/archive/2008/11/26/1341551.html