$.ajax({
type:'post',
url:'<%=deleteAction%>',
data:{sn:key},
beforeSend:function(XMLHttpRequest){
alert("1beforeSend");
,
success:function(data){
swal({
title: "删除成功",
text: "",
type: "success"
}, function () {
$('form').submit();
});
},
complete:function(XMLHttpRequest,textStatus){
alert("2textStatus:"+textStatus);
if(textStatus=='timeout'){
alert("timeout");
}else{
alert("3no---timeout");
}
},
error: function(XMLHttpRequest, textStatus, errorThrown){
alert(XMLHttpRequest.readyState + XMLHttpRequest.status + XMLHttpRequest.responseText);
}
});
$.post(
'<%=deleteAction%>',
{sn:key},
function(data,status){
/* alert(data); */
/*alert(status); */
if(status=="success"){
swal({
title: "删除成功",
text: "",
type: "success"
}, function () {
$('form').submit();
});
}else{
swal({
title: "删除失败",
text: "",
type: "error"
}, function () {
window.location.href = "<%=searchAction%>";
});
}
});