Ajax jQuery-意外令牌:

时间:2019-05-25 08:05:20

标签: jquery ajax

我有一个像这样的Ajax方法。

      $.ajax({
            url: location.origin+"path to file",
            method: 'PUT',
            contentType: 'application/json',
            dataType: 'jsonp',
            crossDomain: true ,
            headers: {
                'Access-Control-Allow-Origin': '*',
            },
            success: function(data) {
                console.log(data);

            },
            error: function(data){
               ...
            }
        });

所以,我想收到如下响应

{"status":"contents updated successfully"}

但是,我收到意外的令牌:同时收到响应。因此进入错误块。

enter image description here

0 个答案:

没有答案