[英]Freebase: How to use the parameter “cursor” with JavaScript
Freebase: (JavaScript) How to use the parameter "cursor" in a query? Freebase:(JavaScript)如何在查询中使用参数“ cursor”?
In the following query, I tried to put the cursor variable within the service_url adding '& cursor' at the end, but it does not work. 在以下查询中,我尝试将游标变量放在service_url中,并在末尾添加“&cursor”,但它不起作用。 Also, I tried to put the property on the var query, but neither works.
另外,我尝试将属性放在var查询中,但均无效。 Finally I put all the variations that I have occurred in the parameters
$.getJSON
, but none has worked for me. 最后,我将发生的所有变体都放入
$.getJSON
参数中,但没有一个对我$.getJSON
。 Someone be so kind and would suggest me how it is used. 有人那么善良,会建议我如何使用它。
var service_url = 'https://www.googleapis.com/freebase/v1/mqlread';
var query = [{
"type": "/music/artist",
"name": [],
"limit: 10
}];
var params = {
"query": JSON.stringify(query)
};
$.getJSON(service_url + "?callback=?", params, function(response) {
document.getElementById('content').innerHTML = JSON.stringify(response);
});
After many hours of truing different sintaxis I've got the right one: 经过数小时的不同提示处理后,我得到了正确的提示:
var service_url = 'https://www.googleapis.com/freebase/v1/mqlread';
var query = [{
"type": "/music/artist",
"name": [],
"limit: 10
}];
var params = {
"query": JSON.stringify(query)
};
$.getJSON(service_url + '?callback=?' + '&cursor', params, function(response) {
document.getElementById('content').innerHTML = JSON.stringify(response);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.