Reputation: 7404
Following is my code :
$.ajax({
url: url,
type: 'GET',
dataType: 'jsonp',
error: function(xhr, status, error) {
alert("xhr="+xhr+" status="+status+" Error="+error);
},
success: function(jsonp) {
alert("success");
}
});
Url contains php file located on external server where I did echo json_encode($array);
Response is shown in firebug net tab but alert showing the following error :
xhr=[object Object] status=parsererror Error=Error: jQuery17209610263814778152_1338375769339 was not called.alert is not showing success
Upvotes: 0
Views: 182
Reputation: 140236
Try this:
echo $_GET["callback"] . "(" . json_encode( $array ) . ");";
Upvotes: 4