From 650e02749b49ef29b9ea1e760e1c5c3246d8ab22 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Fri, 17 Nov 2023 12:26:26 -0800 Subject: [PATCH] Typo --- .../web/api/history_api/working_with_the_history_api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/history_api/working_with_the_history_api/index.md b/files/en-us/web/api/history_api/working_with_the_history_api/index.md index 5af4a5b38b9fee9..2df3468a2e863e7 100644 --- a/files/en-us/web/api/history_api/working_with_the_history_api/index.md +++ b/files/en-us/web/api/history_api/working_with_the_history_api/index.md @@ -166,7 +166,7 @@ const initialState = { history.replaceState(initialState, "", document.location.href); ``` -On page load, we collect all the parts of the page that we need to restore when the user returns to the starting point for the SPA. This has just the same structure as the JSON that we fetch when handling other navgations. We pass this `initialState` into `replaceState()`, which effectively adds the state object to the history entry. +On page load, we collect all the parts of the page that we need to restore when the user returns to the starting point for the SPA. This has just the same structure as the JSON that we fetch when handling other navigations. We pass this `initialState` into `replaceState()`, which effectively adds the state object to the history entry. Now, when the user goes back to our starting point, the `popstate` event will contain this initial state, and we can use our `displayContent()` function to update the page.