gpt4 book ai didi

javascript - Ajax调用总是失败

转载 作者:行者123 更新时间:2023-11-28 08:55:08 29 4
gpt4 key购买 nike

<script type="text/javascript">
function dialogsf() {
$("#loadingsf").dialog({
hide: 'slide',
show: 'slide',
autoOpen: true
});
$("#loadingsf").dialog('open').html("<p>Please Wait while contacts are imported...</p>");
//alert("dfsd");
}
var fd = 1;
$(document).ready(function () {
dialogsf();
$.ajax({
url: "get_contacts.php",
type: "GET",
data: {
sid: 'a'
},
processData: false,
contentType: false,
success: function (response) {
// alert("Import done successfully with "+contacts.length+ " contacts");
alert("Import done successfully");
$('#loadingsf').html("<p>Result Complete...</p>");
}
}).fail(function (xhr, status, error) {
alert('error:' + status + ':' + error + ':' + xhr.responseText)

}).done(function (respond) {
location.href = respond;

});

});
</script>
<body >
<div id="loadingsf" title="SF Contact Import">
<p>Please wait ...</p>
</div>

这是我正在处理的片段。当我运行特定页面时,我收到此 "error:error::"不知道为什么ajax调用总是失败,控制台也是空的

最佳答案

删除 contentType:false 或将正确的 contentType 设置为 contentType: "application/json"

关于javascript - Ajax调用总是失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18611871/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com