Jquery 如果此脚本失败或成功,如何放置警报消息
}))Jquery 如果此脚本失败或成功,如何放置警报消息,jquery,Jquery,})) 我是这个PL的新手,这个脚本就像我想要的那样工作,但是我认为缺少了一些东西,谢谢你的帮助:)当请求失败时,你可以使用fail回调来执行一些特定的操作 $(document).ready(function(){ window.setInterval(function(){ $.post("countest.php", {loader:1},function(data){ $("#inc").html(data) }); },5000); 请给这个问
我是这个PL的新手,这个脚本就像我想要的那样工作,但是我认为缺少了一些东西,谢谢你的帮助:)当请求失败时,你可以使用
fail
回调来执行一些特定的操作
$(document).ready(function(){
window.setInterval(function(){
$.post("countest.php",
{loader:1},function(data){
$("#inc").html(data)
});
},5000);
请给这个问题增加一点上下文。脚本的具体用法以及参数对应的内容等。这样做将帮助其他成员回答此问题。感谢您的回答:)
$.post("countest.php",{loader:1},function(data){
$("#inc").html(data)
})
.fail(function() {
alert( "error" );
});