CakePHP: AJAX Callbacks Order

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 <div> it will be updated between the Interactive and Complete steps.

2 Replies to “CakePHP: AJAX Callbacks Order”

  1. Hi Martin,
    It was valid for version 1.1. I have not tested it with the latest 1.2 release of CakePHP, sorry.
    Good luck with you projects!
    -Eric

Leave a Reply

Your email address will not be published. Required fields are marked *