json - JQuery UI Autocomplete JSONP query/callback -
json - JQuery UI Autocomplete JSONP query/callback -
i've looked @ other topics regarding jquery autocomplete , talking using json, still having issues getting source work me.
i have working yui autocomplete @ moment switch jquery ui help streamline styling.
for yui autocomplete have:
yui().use('array-extras', 'autocomplete', 'autocomplete-highlighters', function (y) { y.one('#ac-input').plug(y.plugin.autocomplete, { resultformatter: function (query, results) { homecoming y.array.map(results, function (result) { homecoming [data styling stuff here]; }); }, //resulthighlighter: 'wordmatch', resultlistlocator: 'character_list', resulttextlocator: 'name', source: 'http://census.soe.com/s:example/json/get/dcuo:v1/character?name=^{query}&callback={callback}&c:show=name,character_id' [this longer...but idea], on : { select : function() {} } }); });
i trying changed jquery ui autocomplete, stuck on source. want like:
$("#autocomplete").autocomplete({ source: function( request, response ) { $.ajax({ url: "http://census.soe.com/s:example/json/get/dcuo:v1/character", datatype: "jsonp", data: { name: "^" + request.term + "&callback=" + request.term + "&c:show...rest of url here" }, success: function( info ) { response( info ); } }); }, select: function() {} });
i confused when info part comes in. samples i've seen have request.term, i'm not sure how style info have query , callback, nor sure how input "^" symbol correctly. newer functionality , advice much appreciated.
json jquery-ui autocomplete
Comments
Post a Comment