Uncaught TypeError: Object has no method 'stopImmediatePropagation'遺漏的類型錯誤:對象沒有方法「stopImmediatePropagation」
下面是完整的代碼,我從9lessons網站獲得。
$(document).ready(function()
{
$(".delete").live('click',function()
{
var id = $(this).attr('id');
var b=$(this).parent().parent();
var dataString = 'id='+ id;
if(confirm("Sure you want to delete this update? There is NO undo!"))
{
$.ajax({
type: "POST",
url: "delete_ajax.php",
data: dataString,
cache: false,
success: function(e)
{
b.hide();
e.stopImmediatePropagation();
}
});
return false;
}
});
}
錯誤指向e.stopImmediatePropagation();
我怎樣才能解決這個問題?謝謝!
您的代碼中的'e'是Ajax響應,而不是事件對象。 – undefined
你想要做什麼? Ajax請求沒有您希望停止傳播的事件 –
總是第一步是檢查jQuery文檔。查看'$ .ajax'的'success'來了解它接受的參數。 http://api.jquery.com/jQuery.ajax/ – elclanrs