Use pushstate and onhashchange if available.