Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js history

// go back:
window.history.back()
// go forward:
window.history.forward()
// go to specific point:
window.history.go(-2) // go back 2 pages, 0 is current page
window.history.go(0) // refreshes current page
window.history.go() // refreshes current page
// get number of pages in history
let numberOfEntries = window.history.length
Comment

history javascript

// Should be null because we haven't modified the history stack yet
console.log(`History.state before pushState: ${history.state}`);

// Now push something on the stack
history.pushState({name: 'Example'}, "pushState example", 'page3.html');

// Now state has a value.
console.log('History.state after pushState: ', history.state);
Comment

PREVIOUS NEXT
Code Example
Javascript :: method chaining in javascript 
Javascript :: moment to date object 
Javascript :: js nuxt read/set cookie 
Javascript :: how to use useref hook in react 
Javascript :: get date from datepicker 
Javascript :: axios react post form data 
Javascript :: run jest test for a single file 
Javascript :: how to get circle around text in react natvie 
Javascript :: Get the current tab 
Javascript :: check if an array contains a number in javascript 
Javascript :: gsap scrolltrigger 
Javascript :: add in to array mongoose 
Javascript :: svg to png base64 javascript 
Javascript :: stateless vs stateful components in react 
Javascript :: String variable props 
Javascript :: change li position in ul jquery 
Javascript :: socket..io 
Javascript :: get filenem js 
Javascript :: array list in javascript 
Javascript :: firebase messaging import script 
Javascript :: redux toolkit how to set empty initial state 
Javascript :: javascript find similar strings 
Javascript :: Destructuring object from a nested object 
Javascript :: Square star pattern in JavaScript 
Javascript :: clone element 
Javascript :: sub array javascript 
Javascript :: javascript set max length of string 
Javascript :: returned value by findOneAndUpdate 
Javascript :: nuxt js file other site 
Javascript :: update array of objects with use state 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =