Skip to content

Commit

Permalink
Fallback to changing window.location when replaceState is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
drawveloper committed Jan 31, 2016
1 parent 26a9a25 commit 599231b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion resources/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ function navigate(n) {
* Updates the current URL to include a hashtag of the current page number.
*/
function updateURL() {
window.history.replaceState({} , null, '#' + currentPosition());
try {
window.history.replaceState({} , null, '#' + currentPosition());
}
catch (e) {
window.location.hash = currentPosition();
}
}


Expand Down

0 comments on commit 599231b

Please sign in to comment.