I need to get the page name from the url. I did like this:
var filename = window.location.href.substr(window.location.href.lastIndexOf('/')+1) // -> 'state.aspx' var statelookup = filename.substr(0, filename.lastIndexOf('.')) // -> 'state'
Now, for example, my statelookup matters as much as New York or North Carolina, how do I replace a hyphen with a space between them?
user407079
source share