jQuery jsonp即使使用有效的json格式也不会触发成功处理程序


$.ajax({
     url: url,
     dataType: 'jsonp',
     success: function(data) { //not firing at all
       console.log('success');
       console.log(data);
     }
     error: function() {  //always firing even with status 200 & valid JSON response.
    console.log('error');
     }             
});
$.ajax({
     url: url,
     dataType: 'jsonp',
     success: function(data) { //not firing at all
       console.log('success');
       console.log(data);
     },                         //You have missed a comma here..
     error: function() {  //always firing even with status 200 & valid JSON response.
    console.log('error');
     }             
});
  • 您漏了一个逗号。
  • 查看评论

相关内容

最新更新