var str = window.location.href; var index = str.lastIndexOf("/"); str = str.substring(index + 1,str.length);console.log(str)