var strUrl = window.location.href; var arrUrl = strUrl.split("/"); var strPage = arrUrl[arrUrl.length - 1]; alert(strPage);