ユーザーが削除ボタンをクリックするとすぐに、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
}
);