我尝试通过POST调用从
AJAX中删除一个项目.
/ DELETE INDIVIDUAL ROW IN A TABLE /
jQuery('.stdtable .delete').live('click', function (e) {
//var newsId1 = $(this).attr("title");
e.preventDefault();
var p = jQuery(this).parents('tr');
if (p.next().hasClass('togglerow'))
p.next().remove();
p.fadeOut(function () {
jQuery(this).remove();
});
$.ajax({
URL: "/AdminPanel/News/DeleteNews",
data: { "newsId": 1 },
dataType: "json",
type: "POST",
success: function (msg) {
alert(msg);
}
});
在这段代码中,我得到了Uncaught TypeError:无法读取未定义的属性’ajax’.