This content originally appeared on Krasimir Tsonev - blog and was authored by Krasimir Tsonev - blog
I hit an interesting "bug" while working on a SPA application. Clicking an anchor link that points to a fragment on the page fires the History API's popstate
event. This triggers some logic on my end, which was not my intent. I fixed that with a bit of JavaScript, and I had to share the snippet.
This content originally appeared on Krasimir Tsonev - blog and was authored by Krasimir Tsonev - blog
Krasimir Tsonev - blog | Sciencx (2022-11-15T20:42:44+00:00) Anchor links pointing to a fragment fires History API’s “popstate” event. Retrieved from https://www.scien.cx/2022/11/15/anchor-links-pointing-to-a-fragment-fires-history-apis-popstate-event/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.