groupon json 请求不起作用
我似乎无法让 jquery 从 groupon API 返回任何内容。
当我签入 apigee 时,我可以执行一个简单的 get 请求来获取所有部门。
但是当我在 JSFiddle 中尝试时,它不起作用
$.get('https://api.groupon.com/v2/divisions.json?client_id=b91d375e38147f3c1e0339a3588d0b791c190424', function(data) {
console.log(data);
});
上面的 $.get 返回一个空的响应。
$.getJSON("https://api.groupon.com/v2/divisions.json?client_id=b91d375e38147f3c1e0339a3588d0b791c190424&jsoncallback=?", function(json) {
console.log(data);
});
这个返回一个错误
invalid label
[Break On This Error] {"divisions":[{"id":"abbotsford","name...owCustomerEnabled":false,"areas":[]}]}
我在这里做错了什么?
这是 JSFIDDLE :
I can't seem to get jquery to return anything from the groupon API.
When I check in apigee I can do a simple get request to get all divisions.
But when I try in JSFiddle it ain't working
$.get('https://api.groupon.com/v2/divisions.json?client_id=b91d375e38147f3c1e0339a3588d0b791c190424', function(data) {
console.log(data);
});
The $.get above returns a response that's empty.
$.getJSON("https://api.groupon.com/v2/divisions.json?client_id=b91d375e38147f3c1e0339a3588d0b791c190424&jsoncallback=?", function(json) {
console.log(data);
});
This one returns an error
invalid label
[Break On This Error] {"divisions":[{"id":"abbotsford","name...owCustomerEnabled":false,"areas":[]}]}
What am I doing wrong here?
Here is the JSFIDDLE :
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要 JSONP,因为它将是跨域的:
You will need JSONP because it will be cross domain: