Topic: Clicking button on submit shows spinner - BACK button problems

Hi,

So I've got this thing where I show a spinner when a submit button is clicked.  The spinner has 'display: none' set on it, and I just 'show()' it.  Easy.

However, after the next page has loaded up, the user presses the browser's back button, the spinner is still showing!  Argh!

How do I make sure the spinner is hidden when the back button is pressed?  I assume I've got to hide the spinner JUST before the current page is about to be unloaded and replaced with the next page?  I'm guessing...

Thanks

Regards,
       Asfand Yar Qazi

Re: Clicking button on submit shows spinner - BACK button problems

Hey there,

You can do:

    Event.observe(window, 'unload', function(){ 
      $('spinner_id_name').hide();
    });

and that should solve that problem.

-patrick

Re: Clicking button on submit shows spinner - BACK button problems

Ah!  That's the ticket...... thanks.

And thanks for finding such and old post and replying to it.