What I get from location.href is like this:
location.href
http://stackoverflow.com/questions/ask
But I only want to get questions/ask
questions/ask
You can use location.pathname.substring(1)
location.pathname.substring(1)