I try to keep it simple:
Problem: how to fetch the first element (weight here) from the new Array with JQuery
Current JQuery:
function xyz()
{
var the_url = 'http://longurl'+encodeURIComponent(searchBox.val());
var x1 = $.ajax({
type: "GET",
url: the_url,
dataType: "script"
});
}
callback_function = function(suggestions)
{
return suggestions[0];
}
JSONP response:
callback_function("w", new Array("weight", "weight loss", "wound"), 0);