2009-10-27 17 views
11

Kullanıcı sil düğmesini tıklattığında jQuery komutum, sunucunun seçili öğeyi silmesini ister.Php kullanarak bir sunucu hatası yanıtı nasıl gönderilir?

Şimdi bir php komut dosyasının bir başarı veya hata yanıtını göndermesini istiyorum.

ürününün silinememesi durumunda numaralı hata geri çağırma olasılığı var mı?

Teşekkür


benim jQuery kodu

: Daha fazla seçenek için

$.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 
} 
); 

cevap

İlgili konular