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
var url = "http://www.cnn.com/news/1234/news.html?a=1&b=2&c=3"; url = url.replace(/^.*\//, "").replace(/\?.*$/, "");
You can substitute url with window.location
url
window.location