Using the URL form its parts and not the whole thing with location.href