What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-20 06:25:16
javascript window.onpopstate example
window.onpopstate = function(event) { alert("location: " + document.location + ", state: " + JSON.stringify(event.state)); const urlParams = new URLSearchParams(window.location.search); const myParam = urlParams.get('myParam'); ... Add solution -
Javascript 2022-02-02 23:11:40
loadsh debounce
// Avoid costly calculations while the window size is in flux.jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debou... Add solution -
Javascript 2021-11-12 14:45:22
react prevent back
const preventBack = (): void => { window.history.pushState(null, "", window.location.pathname); } const handleBack = (): void => { console.log('handleBack') } useEffect(() => { preventBack(); window.addEventListener('popstate'... Add solution -
Javascript 2021-11-12 02:07:19
detect back button press javascript
So as far as AJAX is concerned... Pressing back while using most web-apps that use AJAX to navigate specific parts of a page is a HUGE issue. I don't accept that 'having to disable the button means you're doing something wrong' and in fact developers in ... Add solution -
Javascript 2021-10-03 11:50:05
prevent browser back button jquery
window.onload = function () { if (typeof history.pushState === "function") { history.pushState("jibberish", null, null); window.onpopstate = function () { history.pushState('newjibberish', null, null); ... Add solution -
Javascript 2021-09-05 22:21:02
js events
Events: Mouse: onclick The event occurs when the user clicks on an element oncontextmenu User right-clicks on an element to open a context menu ondblclick The user double-clicks on an element onmousedown User presses a mouse button over an element onmous... Add solution