SAJAXian Quirk
By Angsuman Chakraborty, Gaea News NetworkSunday, May 14, 2006
Playing with SAJAX (AJAX framework for php, ruby etc.) I found an interesting quirk. Keep this in mind while using SAJAX (unless you have already found it (or want to find) the hard way).
If an exported function is called with all its arguments and without the callback at the end (as the last argument) then it ignores the last argument, possibly confusing it for a callback.
This is particularly interesting because SAJAX also provides a way to pass argument by setting sajax_target_id variable. So it is not unusual to expect that when sajax_target_id is set then it wouldn’t search for a callback in the function arguments. However that is not the way it is implemented.
BTW: Sajax examples are very poorly done. Anyone looking at their code will get a very bad feeling about the competence of the team. However the actual code is better.