2009-10-27 55 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 
} 
); 

回答

相關問題