-1
HTTP API请求填入HTML表我有一个表与流星
<table>
<thead>
<tr>
<th>Year</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>1990</td>
<td>-</td>
</tr>
...
</tbody>
</table>
,我想打一个GET请求世界银行API在此表中填写的值。
我的GET请求是流星方法
Meteor.methods({
getData: function() {
try {
const url = 'http://api.worldbank.org/countries/br/indicators/NY.GDP.MKTP.CD?date=1990:2000&format=json';
const request = HTTP.get(url);
return request;
} catch (e) {
console.log(e);
return false;
}
},
});
,我打电话给我的方法从客户端
Meteor.call('getData', function(error, result) {
console.log(result);
});
所以我在控制台中的值,但我想更换-
在正确的值的HTML表格。