这里是我的代码:
var jsonURL = "http://www.sodexo.fi/ruokalistat/output/daily_json/440/2013/10/25/fi";
var request = $.ajax({
url: jsonURL,
dataType: "json",
type: "GET"
});
request.done(function(msg) {
alert(msg);
});
request.fail(function(jqXHR, textStatus) {
alert("Request failed: " + textStatus);
});
我到底做错了什么?我得到这个代码只parseError。谢谢你们的帮助。
因为它似乎跨域ajax请求,所以'dataType'应该是'jsonp'。 – Jai
这可能会帮助你:http://stackoverflow.com/questions/11736431/make-cross-domain-ajax-jsonp-request-with-jquery – Jai
更改dataType为jsonp没有这样做。 parsererror仍然是我得到的。 – samiljin