gAjax
This package can be used to execute PHP functions from Javascript using AJAX calls. It registers PHP function that may be called from Javascript. Then it can generate the necessary Javascript code to call those PHP functions using AJAX. A separate helper class can be used to generate Javascript code to be executed when the PHP functions are called.