In CakePHP there is an AJAX helper based on the Prototype library. During an AJAX event, such as clicking a link generated by the AJAX helper ($ajax->link()) you can add javascript call-backs to the $options parameter. These are the callbacks, in the order they are called:

  1. before
  2. loaded
  3. interactive
  4. complete
  5. after
  6. loading

I was expecting a different order, such as loading to come before loaded, but this is how it is!

Also, if you're updating the content of a

it will be updated between the Interactive and Complete steps.