一旦用户点击删除按钮我的jQuery脚本要求服务器删除选定的项目。
现在,我想我的PHP脚本发送成功或错误响应。
是否有可能在火灾情况下,错误回调的项目无法删除?
谢谢
我的jQuery代码:
$.ajax({
type: "post",
url: "myAjax.php" ,
dataType: "text",
data: {
some:data
},
error: function(request,error)
{
// tell the user why he couldn't delete the item
// timeout , item not found ...
},
success: function ( response )
{
// tell the user that the item was deleted
// hide the item
}
);