Can I use the jQuery $.ajax() method instead of the provided sample code? For some reason I am attempting this but it is not working:
$(function() {
alert("Hi");
$.ajax({
url: "http://private-174c-themoviedb.apiary.io/3/search/movie?api_key=[pastedMyApiKeyHere]",
contentType: "application/json",
type: "GET",
crossDomain: true,
success: function(data) {
alert("It worked");
},
error: function(err) {
alert(JSON.stringify(err));
}
});
});
Any insight would be greatly appreciated. Thank you!
找不到电影或节目?登录并创建它吧。
Travis Bell 的回复
于 2012 年 10 月 24 日 11:25上午
First, our API doesn't support JSONP without adding a callback param. Try adding it to your quest.
Secondly, remember Apiary is only to be used for testing. Make sure to try that request on the real production end point.
blaster151 的回复
于 2012 年 10 月 25 日 3:54下午
That helped - thanks!