CakePHP: AJAX Callbacks OrderFiled Under: CakePHP
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:
- before
- loaded
- interactive
- complete
- after
- 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.
- Permalink
- eric
- 8 May 2007 9:40 AM
- Comments (2)
June 8th, 2009 at 11:28 am
This do not seems logical. Do you know if this is still true in newer releases of CakePHP?
If you look at http://book.cakephp.org/view/209/AjaxHelper-Options#Callback-Options-211 the description indicates other.
…”complete” – JavaScript callback to be run when XMLHttpRequest is complete.
June 8th, 2009 at 2:21 pm
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