views:

27

answers:

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.

+2  A: 

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