Skip to content

web-profile

  • Plugins
    • Anti-spam Pro
    • Fortify
    • Page-list
    • iframe
    • Sitekit
  • web
    • React
    • Angular
    • Flexify
    • css
  • Python
  • Sitemap
  • Contact
  • Newsletter
  • Ads
  • Donate
  • Shop
    • My account
    • Checkout
    • Cart

Javascript - Check if browser back button was clicked

Reload the page with javascript if browser back button was clicked


if (window.performance && window.performance.navigation && window.performance.navigation.type &&

	window.performance.navigation.type == 2) {

	window.location.reload(false);

}

  • Navigation Timing API
  • Can I use Navigation Timing API
  • Navigation Timing API on W3

siblings:

  • Javascript - Check if browser back button was clicked
  • javascript add custom click event
  • javascript add/remove class on click
  • javascript delegate custom click event
  • javascript DOM loaded
  • javascript find an element in array
  • JavaScript loop through object (keys and values)
  • javascript reverse string
  • javascript string to number
  • javascript number to string
  • javascript array length
  • javascript substring
  • javascript benchmark
  • javascript function default value for parameter
  • javascript toolbar example
  • javascript url to link
  • var funcName = function() {} vs function funcName() {}
  • javascript string replace
  • javascript find occurrence in string
  • randomize (shuffle) an array
Find your balance
© 2025 web-profile • Built with GeneratePress