consuming API JSon calls through TVJS-tvOS

前端 未结 6 722
终归单人心
终归单人心 2021-02-06 10:32

I am trying to play with tvOS, and I have small question regarding handling json call. I have to get some data through an API, let\'s say for sake of test that I am calling this

6条回答
  •  爱一瞬间的悲伤
    2021-02-06 11:01

    Did you call your function in the 'App.onLaunch'

    App.onLaunch = function(options) {
      var url = 'http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location%3D%223015%22&format=json';
      var doc = getDocument(url);
      console.log(doc);
    }
    

    Might be worth looking at https://mathiasbynens.be/notes/xhr-responsetype-json

提交回复
热议问题