1

What event can i use to run code when a user visits another page then hits back to load my page again?

I wrote window.onload = function() { ... and it works when i hit refresh but not forward then back.

  • @Marcel Korpel I also do think so, anyway you could possibly work with a cookie (altough a short lived one), if not cookie ther are other techniques like using a script (because it would be most likely be loaded from the cache), but it wouldn't be 100% reliable – dvhh Oct 19 '10 at 16:44

1 Answers1

2

This jQuery plugin is pretty good. http://www.asual.com/jquery/address/docs/

And here's some info on the underlying JavaScript events involved in it's implementation http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript

Alex
  • 326
  • 2
  • 5