js/application.js: Fixed compatibility with history.