loopj/jquery-tokeninput — Issue #242: Adding web service support
Author: Geminior
Created: 2012-01-02 13:47:09+00:00
State: open

Hi,

I added an isWebService setting, and added the following to the setup code before the ajax request is invoked.

if (settings.isWebService) {
ajax_params.data = '{"' + settings.queryParam + '":"' + query + '"}';
ajax_params.contentType = "application/json; charset=utf-8";
}
else {
ajax_params.data[settings.queryParam] = query;
}

which basically lets you invoke an ajax enabled web service, taking one argument called the same as the queryParam, e.g. q.

brgds,
Thomas Scheelhardt