Horje
back button event listener javascript Code Example
listen back button event listner
window.history.pushState({page: 1}, "", "");

window.onpopstate = function(event) {

  // "event" object seems to contain value only when the back button is clicked
  // and if the pop state event fires due to clicks on a button
  // or a link it comes up as "undefined" 

  if(event){
    // Code to handle back button or prevent from navigation
  }
  else{
    // Continue user action through link or button
  }
}
back button event listener javascript
function goBack() {
    window.location.hash = window.location.lasthash[window.location.lasthash.length-1];
 	window.location.lasthash.pop();
}




Javascript

Related
how to find remainder in javascript Code Example how to find remainder in javascript Code Example
add word in string in javascript Code Example add word in string in javascript Code Example
javastring setstate Code Example javastring setstate Code Example
linux command to install standard js Code Example linux command to install standard js Code Example
javascript regex grouping replace Code Example javascript regex grouping replace Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7