Could someone recommend a way to get page name from a url using JavaScript?
For instance if I have:
http://www.cnn.com/news/1234/news.html?a=1&b
I think it's
window.location.pathname.replace(/^.*\/([^/]*)/, "$1");
So,
var pageTitle = window.location.pathname.replace(/^.*\/([^/]*)/, "$1");