2009-10-27 54 views
11

只要用户点击删除按钮我的jQuery脚本要求服务器删除选定的项目。如何使用php发送服务器错误响应?

现在我想要我的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 
} 
); 

回答

相关问题