Questions tagged [pushstate]
The HTML5 History API allows a web page to manipulate the contents of the history stack in order to dynamically update the URL and respond to the back button.
pushstate
631
questions
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 ...
0
votes
0
answers
45
views
URL exists only in history.pushState()
I'm using WP plugin Search and Filter + Dynamicoo for Elementor.
Search and Filter generated results using ajax and URL look like: "sitename.com/staff/?sft_brand1"
But this page does not ...
0
votes
2
answers
196
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 ...
0
votes
1
answer
287
views
React- adding query param with pushState adds trailing slash before params (without react router)
I'm trying to manipulate my query params directly without any library (like react-router- because i don't need them now).
The problem is when i try to add query params using this codes:
let url = new ...
0
votes
1
answer
96
views
I need to prevent showing previous pages from my django app
Even after I logged out I'm still able to see my previous pages how to prevent the browser from showing this?
I tried this piece of JavaScript code .
Note: I used template inheriting and templates ...
0
votes
1
answer
64
views
Chrome Extension scripts: simpler way to listen for any type of URL visit?
Update: This was an oversight on my behalf - Tabs.onUpdated.addListener does indeed fire on all mentioned events, I just had a hidden guard clause that was blocking it from firing on pushstate/...
0
votes
3
answers
247
views
prevent javascript to encode url
I am trying to change url with pushstate in java script and my url doesn't have any space or bad character for url but java script encode it and add some character in it.
my code is:
name= name....
0
votes
1
answer
43
views
Get active a tags switching to work with pushState?
I have a single page website and I am using an ACTIVE class on the nav to highlight the links in the NAV.
The javascript to make nav links active:
$(document).ready(function () {
$('.inner-nav li ...
0
votes
1
answer
119
views
history.pushState on sub pages in an Angular.js application
I have a blank Angular.js 6 application that uses PathLocationStrategy for routing, and when on a subroute (e.g. /test) and executing the following:
history.pushState({}, '', '#abc');
window....
1
vote
0
answers
276
views
Why does history.pushState() not get respected when using the built in browser back button in Safari 16.* and Chrome 107.0.5304?
I've found that in these versions of Safari and Chrome, pushing a new state value into the browsers history with no user input will behave unexpectedly. It will correctly update the state. You will be ...
2
votes
1
answer
4k
views
React Router 6 - useLocation Not Working Like I Expected [duplicate]
I'm new to React, so I'm sure I'm not understanding the use cases for useLocation - like what it is good for and what it is not intended for.
I'd like to have a method that a specific component can be ...
0
votes
0
answers
102
views
( jQuery Pjax ) and WordPress
when using AJAX in WordPress, All the AJAX requests should be sent to wp-admin/admin-ajax.php file to process then this file will return the appropriate result
I want to use PJAX with WordPress but I ...
0
votes
0
answers
731
views
Back button override: onpopstate and pushState trick only works when content is clicked
I'm using pushState to have adaptative URLs on a single-page web app. I'm also using onpopstate to have native-like behaviour with mobile devices' back button. I have managed not to lock the user out ...
1
vote
1
answer
113
views
Switch slider (using a checkbox) is flickering with AJAX "back" history
The following code queries a state.json file on load and updates the slider switch. It uses fetch(...). It works.
When clicking on the text "Click on this text...", the top div is replaced ...
1
vote
1
answer
566
views
Prevent Adding To History API Array
Is it possible to prevent adding the current Page URL to the History if user is on specific/same page and only location.search parameters change?
The page reloads with new search params but I'm not ...