diff --git a/notes/navigation-in-elements.md b/notes/navigation-in-elements.md index 7c1c9b5..51bdb8f 100644 --- a/notes/navigation-in-elements.md +++ b/notes/navigation-in-elements.md @@ -19,7 +19,7 @@ var app = Elm.Main.init({ }); // Inform app of browser navigation (the BACK and FORWARD buttons) -document.addEventListener('popstate', function () { +window.addEventListener('popstate', function () { app.ports.onUrlChange.send(location.href); });