JS gets a simple instance of the current page name
// Take the current page name (without the suffix) function pageName() { var a = location.href; var b = a.split("/"); var c = b.slice(b.length-1, b.length).toString(String).split("."); return c.slice(0, 1); } // Take the current page name (with the suffix) function pageName() { var strUrl=location.href; var arrUrl=strUrl.split("/"); var strPage=arrUrl[arrUrl.length-1]; return strPage; }The above simple example of JS obtaining the current page name is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.