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
var uri = window.location.href.substr(window.location.protocol.length + window.location.hostname.length + 2);
This code also includes GET and HASHTAGS (basically everything after hostname)