用户点击后立即 删除按钮 我的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
}
);