Skip to main content

Questions tagged [html5-history]

The HTML5 History API allows programmatic manipulation of the browser's history through JavaScript, providing a method of managing the user's history stack when creating web applications.

html5-history
0 votes
0 answers
61 views

Clearing back/forward cache only after logout

After a user has logged in or out, and the browser back button is used, the page is restored from the bfcache, The page is restored even when a logged out user isn't supposed to access this page. I ...
Patrick Miah's user avatar
0 votes
0 answers
87 views

How to detect if a URL has changed in TMS WEB Core?

I have a TMS WEB Core application with code all over the place that changes the URL via the window.history.pushState function. Is there a way I can detect when the URL has changed? Let's say for ...
Shaun Roselt's user avatar
  • 3,045
0 votes
0 answers
36 views

Ensure Javascript factory method executes only once

I am using Tabler Bootstrap template and HTMX. As can be seen in the vertical layout (select it from the 'Layout' menu) of the Tabler preview, on reducing the width of the browser window, the left ...
amolbk's user avatar
  • 807
0 votes
1 answer
48 views

How to show index.html on every request in vanilla JavaScript

I'm working on a project using vanilla JavaScript. I want to build a spa(single page application) router. If you visit the pages by clicking on one of links, the screen is not re-rendered. But if you ...
myeongin's user avatar
0 votes
2 answers
233 views

how to trigger a react component re-render after changing query param (without react-router)

In the react component below I want to display the current value of a url query param after updating it. Something like this is straightforward to do with react-router, but I am trying to implement ...
D2024's user avatar
  • 13
-1 votes
1 answer
27 views

Using the History API to 'rewrite' the displayed address, when the user visits the URL the server gives a 404 error

The History API is being used to rewrite/set the displayed address as part of SPA navigation, for example: history.pushState({}, `example`, `/example.htm`); The example.htm page does not exist on the ...
Ely's user avatar
  • 1
6 votes
1 answer
190 views

What determines where the focus goes back to when clicking on a browser's back button?

As far as I can tell, it is in part determined by the HTML spec's History API1, specifically the value of history.scrollRestoration. Quoting the HTML spec's scroll restoration mode paragraph: "...
toraritte's user avatar
  • 7,615
-1 votes
1 answer
73 views

Creating custom history back and forwards buttons using a React hook

I would like to create custom history back and forwards buttons using a React hook. For reference, in case it helps, I'm trying to replicate the behaviour that can be seen in Spotify's web app. Their ...
Alex's user avatar
  • 1,321
0 votes
0 answers
25 views

Attach client side only state to history in Sveltekit

What is the best way to work with client side state and the browser's history api? As a learning experiment I'm building a dungeon crawler style webapp. Based on URL segments it renders a piece of the ...
Boris Callens's user avatar
0 votes
1 answer
264 views

Hook into Safari back button click

We have a survey in a single-page app. Because it's a survey, we want to allow users to go back but not forward in history. That is, if they change an answer in the "past" it may affect ...
thinnerwhiterduke's user avatar
0 votes
1 answer
285 views

How do I make scrolling update the history in next.js?

Quick note: this question is not seeking to scroll when a linked is clicked, and is not seeking to restore the scroll position when a link is clicked, but rather to add new items to the browser state ...
mikemaccana's user avatar
0 votes
1 answer
20 views

i cant seem to load fonts using the unicodes

when i load a default icon(box) is loaded in placement of the icon i wish to use(a searchbox). The icon i am using is from fontawsome and its my first time using it. I tried using google fonts and got ...
Kaylin Heru's user avatar
0 votes
0 answers
76 views

How to return an empty pushState (or clear the current state) when fetching the index page

I am trying to turn a Tumblr site into a single page application. Currently my page links work, I parse the href attribute for each link, fetch the corresponding page, then update the pushState as ...
lharby's user avatar
  • 3,204
0 votes
0 answers
33 views

How to properly use a counting loop in Javascript +HTML [duplicate]

In Javascript, I am trying to create a counting loop that adds one to a number. I am new to counting loops in the context of Javascript, but i tried my best and found something from the Internet. This ...
user20967710's user avatar
0 votes
2 answers
195 views

Replacing history.pushState to send events (getting Ilegal invocation error)

I have a lib which is added in a SPA project which uses router.push(which will eventually call window.history.pushState) to make the url changes. However I need my lib to be able to listen to these ...
Rafael Costa's user avatar
  • 1,421

15 30 50 per page
1
2 3 4 5
41