Maison  >  Questions et réponses  >  le corps du texte

javascript - ajax错误信息 {readyState: 4, status: 200, statusText: "load"}

用 ajax 发请求时,错误信息中 readyStatestatus 都正常, 而 statusText 是 "load",请问一下这是什么错误。我在网上找的大家都是 statusText:"success" 错误

handleClick() {
    $.ajax({
      url:'http://*****/user.json',
      type: 'get',
      dataType: 'jsonp',
      success: function(data){
        console.log(data);
        this.state.data = data;
      },
      error:function(err){
        console.log(err);
      }
    })
  }
  

response 中也拿到了 json 数据:

这是打印的信息

阿神阿神2720 Il y a quelques jours1107

répondre à tous(2)je répondrai

  • 阿神

    阿神2017-04-11 11:04:44

    把你的ajax代码贴出来看一下什么原因

    répondre
    0
  • 巴扎黑

    巴扎黑2017-04-11 11:04:44

    http://stackoverflow.com/ques...

    That suggests that the HTTP request was successful but the attempt to parse the data was not.

    i.e. that the data was not formatted as JSONP.

    répondre
    0
  • Annulerrépondre