Scriptaculous Ajax Autocomplete callback example


Posted by Andrew McCombe on Sat Dec 6, 2014

Recently, whilst working on an old website at work, I found a need to add additional parameters to a Script.aculo.us Ajax.autocomplete call The documentation show that this is possible via the callback function but unfortunately there isn’t an example provided.

Googling found a page that had an example but unfortunately the page wasn’t available. One quick visit to the Internet Archive’s wayback machine and the page was found. So, here’s how to use the callback function on a script.aculo.us Ajax.Autocomplete:

This will add the &format= parameter to the default parameters sent by the Autocompleter code.

I hope this helps someone in the future.