I am using jQuery Version 1.5.1 to do the following ajax call:
1
2
3
4
5
6
7
|
$.ajax({
dataType:
'jsonp'
,
data: { api_key : apiKey },
success:
function
(data) { console.log(data); },
error:
function
(jqXHR,textStatus,errorThrown) { console.log(errorThrown); console.log(textStatus); }
});
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{
"response"
: {
"type"
:
"category"
,
"entries"
:1,
"params"
:{
"format"
:
"json"
,
"id"
:
"406"
,
"callback"
:
"jQuery15109935275333671539_1300495251986"
,
"_"
:
"1300495252693"
},
"pages"
:1,
"result"
:{
"category"
:{
"product_count"
:0,
"id"
:406,
"restful_path"
:
"/categories/406"
,
"parent_id"
:
null
,
"name"
:
"Oberteile"
}
}
}
}
|
But the success callback is never called,instead the error callback produces this output:
答案详见:点击打开链接