jQuery.ajax () parsererror

когда я пытаюсь получить JSON из http: // api-v3 .deezer.com / 1.0 / search / album /? q = beethoven & index = 2 & nb_items = 2 & output = json с:

(jQuery 1.6.2)

$.ajax({
    type: "GET",
    url: url,
    dataType: "jsonp",
    success: function (result) {
        alert("SUCCESS!!!");
    },
    error: function (xhr, ajaxOptions, thrownError) {
        alert(xhr.statusText);
        alert(xhr.responseText);
        alert(xhr.status);
        alert(thrownError);
    }
});

Я получаю: parsererror; 200; undefined; jquery162 ******** ************ был вызван не

, а с помощью JSON из http://search.twitter.com/search.json?q=beethoven&callback=?&count=5 работает отлично. Оба являются допустимыми форматами JSON. Так что это за ошибка?

[ОБНОВЛЕНИЕ]

@ 3ngima, я реализовал это в asp.net,он отлично работает:

$.ajax({
    type: "POST",
    url: "WebService.asmx/GetTestData",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (result) {
        alert(result.d);
    }
});

WebService.asmx:

[WebMethod]
public string GetTestData()
{
    try
    {
        var req = System.Net.HttpWebRequest.Create("http://api-v3.deezer.com/1.0/search/album/?q=beethoven&index=2&nb_items=2&output=json");
        using (var resp = req.GetResponse())
        using (var stream = resp.GetResponseStream())
        using (var reader = new System.IO.StreamReader(stream))
        return reader.ReadToEnd();
    }
    catch (Exception) { return null; }
}

22
задан ndsmyter 20 April 2013 в 09:18
поделиться