Assigning parameters for ajax in cakePHP

I have ajax-> autoComplete working dandy with cakePHP. Now I want to add my own javascript (preferably callback methods) after making the request. I know there are ajaxHelper related parameters , but I can't figure out how to apply them to the autocomplete function.

I can get ajax->autoComplete('div', 'url', array('with'=> 'console.log("hello")'))

to execute before anything happens the first time, but none of the other options related to this above work (I guess because the "c" puts the javascript right in the url, so obviously it will execute), I also read the autoComplete API and searched the language for a bit, but can't find any examples or documentation on how to apply the parameters.

0


a source to share


1 answer


You are right, there are AJAX options. And so, here it is:

http://api.cakephp.org/view_source/ajax-helper/#line-129



You can use any of these parameters in the options array.

+1


a source







All Articles