script is not loading on Browser Back button issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhavani123
    New Member
    • Feb 2014
    • 1

    script is not loading on Browser Back button issue

    I am working in an ecommerce site.I had a requirement that my cart ribbon should show the number of items in my cart.I placed the code(which is giving number of items)inside a document.ready function.But when i presses browser back button in firefox my page is not loading so it is showing number of items empty.I need to execute my code in case of browser back button event also.Any solution would be appreciated.I tried keep my code in onbeforeunload function also.But not working.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I need to execute my code in case of browser back button event also
    then hook into that event.

    ref. https://developer.mozilla.org/en-US/...dow.onpopstate

    Comment

    Working...