Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: history-api demo #237

Merged
merged 4 commits into from
Nov 17, 2023
Merged

fix: history-api demo #237

merged 4 commits into from
Nov 17, 2023

Conversation

OnkarRuikar
Copy link
Contributor

@OnkarRuikar OnkarRuikar commented Nov 17, 2023

Some issues to fix:

/cc @wbamberg

@@ -23,7 +23,7 @@ document.addEventListener("click", async (event) => {
displayContent(json);
// Add a new entry to the history.
// This simulates loading a new page.
history.pushState(json, "", creature);
history.pushState(json, "", `${creature}.html`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say "advertised as" do you mean in the href? Do you think it is better to update the state, as here, or to update the href? (it feels better to me to update the href but not sure why).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say "advertised as" do you mean in the href?

Yes, when we hover over a link it shows the anchor's path in bottom left corner of the browser.

it feels better to me to update the href but not sure why

In single page applications static looking links feel odd. Let's get rid of .html from paths.

@OnkarRuikar OnkarRuikar requested a review from wbamberg November 17, 2023 17:52
Copy link
Contributor

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice!

@wbamberg wbamberg merged commit d2680f1 into mdn:main Nov 17, 2023
@OnkarRuikar OnkarRuikar deleted the patch-1 branch November 17, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants