jQuery(document).ready(function () { var aToken = document.getElementById('aToken').value; jQuery("#name_inp").autocomplete("https://graph.facebook.com/me/friends?access_token="+aToken, { width: 500, height: 200, max: 5000, dataType: 'json', cacheLength: 100, minChars: 1, parse: function (data) { alert(data); var rows = new Array(); data = data.data; console.log(data); for (var i = 0; i < data.length; i++) { rows[i] = { data: data[i], value: data[i].name, result: data[i].name }; } return rows; }, formatItem: function (data, i, n, value, text, a, b, c, d) { var x = getImage(data.id); return "<div class='test2' onclick='return getId("+data.id+");'><span>" + data.name + "</span></div>"; }, } ) });
The above code helps to get the friends list of users from a remote api call. Any help can be used to save json data and search with user request and populate from a stored variable.
to save time and fill out the result accurately.
thanks..
source share