I’m trying to work with the freebase API but am hitting a snag with the basic formatting for the query I want to build…
The commented out query below works fine… but not my attempt above. I’m sure the solution is simple but I haven’t been able to work it out.
$.ajax({
url: "https://www.googleapis.com/freebase/v1/mqlread",
//url: "https://www.googleapis.com/freebase/v1/search",
dataType: "jsonp",
data: {
query: [{
"limit": 8,
"name": null,
"name~=": request.term+"*"
}]
//query: '[{"name":null,"name~=":"ambrose*","limit":8}]'
},
success: function( data ) {
response( $.map( data.result, function( item ) {
return {
label: item.name,
value: item.name
}
}));
}
});
Commented line value is string(between
' '):and here we have array:
change to:
and now should work
UPDATE:
convert json to string: