我正在尝试使用tvOS,我对处理json调用有一个小问题.我必须通过API获取一些数据,让我们说为了测试我正在调用此链接
http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location%3D%223015%22&format=json
Run Code Online (Sandbox Code Playgroud)
我尝试使用此功能进行一些修改
function getDocument(url) {
var templateXHR = new XMLHttpRequest();
templateXHR.responseType = "json";
templateXHR.open("GET", url, true);
templateXHR.send();
return templateXHR;
}
Run Code Online (Sandbox Code Playgroud)
但没有成功.任何提示或帮助?
如果我需要使用NodeJS,我该怎么办?