开发者

DailyMotion API not returning JSON object?

开发者 https://www.devze.com 2023-03-06 17:48 出处:网络
I\'m trying to access the DailyMotion API. Try running this in your JavaScript console: $.getJSON(\'https://api.dailymotion.com/video/xirgl9?fields=id\', function开发者_如何学JAVA(data) {

I'm trying to access the DailyMotion API. Try running this in your JavaScript console:

$.getJSON('https://api.dailymotion.com/video/xirgl9?fields=id', function开发者_如何学JAVA(data) {
  console.log(data);
});

Anyone know why this doesn't work and returns code 200 but no data? Because if you manually type in the URL

https://api.dailymotion.com/video/xirgl9?fields=id

A proper JSON object does indeed return.


this should be jsonp. add &callback=? to the end of your url and you'll get the proper objects back.

0

精彩评论

暂无评论...
验证码 换一张
取 消