613 questions
0
votes
0
answers
35
views
PushState() removes previous entries or creates doubles
Here's my code:
$.ajax({
url: link,
type: 'get',
data: {},
success: function(res) {
document.title = res.title;
document.description = res.description;
$('body').html(res.html);
...
0
votes
0
answers
34
views
Discriminate between browser load and browser navigation
Is it possible to check if the browser is loading a page through a page refresh or URL access, or if it is navigating through the browser history (back/forward)?
I'm building an app with Nuxt where I ...
0
votes
1
answer
47
views
Prevent full page load when clicking the forward button with popstate event
I'm creating a SPA that has multiple pages that have some hierarchy. The user can click on any item in a list to see details (going forward) and on the details page can click a "back" button ...
1
vote
0
answers
96
views
Using RouterLink and State to pass an object from one component to another, after a refresh on the child component, it loses its class
https://stackblitz.com/edit/stackblitz-starters-cdffrt
The issue is after navigating to the person details component, if you refresh the page, this.person doesn't seem to know that it's a Person class,...
1
vote
1
answer
118
views
When does the popstate fire? What is it dependent on?
I found that popstate fires when the user presses back or forward button. But that does it mean it is the default behaviour of the browser. Suppose a website doesn't use SPA, clicking on a link loads ...
0
votes
1
answer
45
views
Change the title and URL on the main page when clicking on a link in the iframe
I need your help, I have a parent A page with an integrated B iframe.
When I click on a link in the B iframe, I want to retrieve the title and url of the clicked link and pass it to the main page to ...
2
votes
0
answers
499
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 ...
0
votes
0
answers
136
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 ...
0
votes
1
answer
192
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 ...
0
votes
2
answers
2k
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 ...
-1
votes
1
answer
54
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 ...
8
votes
1
answer
508
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:
"...
-1
votes
1
answer
238
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 ...
0
votes
1
answer
705
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 ...
0
votes
1
answer
457
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 ...