JQuery.AJAX fails even though firefox says code 200
ajax, javascript, jquery
Solution
This will work, for cross domain
var baseURL = "http://api.rottentomatoes.com/api/public/v1.0.json";
var apiKey = "myAPIKEy";
$.getJSON (baseURL + "?callback=?", { apikey: apiKey }, function(data){
return data;
});
Problem
I cannot get the jQuery to return a success even though the URL which it generates works. The code is as follows: ``` var baseURL = "http://api.rottentomatoes.com/api/public/v1.0.json"; var apiKey = "myAPIKEy"; $.ajax ({ type: "GET", url: baseURL, data: { apikey: apiKey }, success:function() { alert('here'); }, complete:function(data) { return data; } }); ``` It does not hit success (I took out failed but it goes into failed). I am not sure why this is failing given I copy paste the generated URL and it works and spits back a response. Please let me know what other information I can provide. I am sorry for being a bit vague. Any help is greatly appreciated!!!