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