error方法中得到, responseText 是 NetworkError: Failed to execute 'send' on 'XMLHttpRequest'
PS: 没有跨域, stackoverflow上有说吧async改为true, 但是依然没有效果.
$.ajax({
url:xxxx,
async: false,
contentType:"application/json",
data: JSON.stringify(req)
success: fun(){},
error: func(){}
})
问题是偶现, 很困惑,希望大家能给一点思路
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
async和contentType都可以省略,问题应该出在json上,建议你更换下data的写法试试~
http://stackoverflow.com/ques...
建议贴出完整代码
尽量用异步。data少了个','号,json后台API能接到吗?
我也遇到过,也没查出原因