Currently I am on this page:
www.mysite.com/page1/
Now I want to get the last portion from that URL which is page1
I am using the following but it's showing me full URL. I need only page1
var curPage = window.location;
How can I get this?
Currently I am on this page:
www.mysite.com/page1/
Now I want to get the last portion from that URL which is page1
I am using the following but it's showing me full URL. I need only page1
var curPage = window.location;
How can I get this?
var curPage = window.location.pathname;
See this URL for more info