I am moving from the PHP AJAX library xajax to jQuery AJAX.
With xajax, I could contain all my AJAX calls inside class methods by binding public class methods to javascript function names (eg. $this->registerFunction('javascriptFunctionName', &$this, 'classMethodName')).
I am hoping there is a way I can do something similar with jQuery AJAX, whereby I can do something like this:
$('#myButton').click(function() {
$.get('class|methodName',
{
parameter: value
},
function(data) {
if (data) {
...
}
else {
...
}
});
return false;
});
});
I know you can AJAX calls to MVC controller methods, but unfortunately my legacy product doesn't use MVC :-(
Please tell me there is a way?
If not, is there a way to map a call to a global PHP function?