这是我关于stackoverflow的第一个问题。我只是想知道为什么我的 getJSON 代码不能与 jQuery 1.4.2 一起使用,但它可以与 jQuery 1.3.2 一起顺利运行
所以这是我的代码
$(document).ready(function(){
$('td.hps_ajax a').click(function() {
id = this.id.replace(/.*hps_ajax/,'');
if(confirm('Anda yakin mau menghapus record ini?'))
$.getJSON('../admin/media_admin/ajaxHapus/'+id, remove_row);
return false;
});
})
function remove_row(data) {
if(data.sukses == '1') {
$('td.hps_ajax a#hps_ajax'+data.id).closest('tr').fadeOut('slow',function() {
$(this).remove();
});
} else {
alert('Gagal menghapus File.');
}
}
getJSON 链接是 CodeIgniter 应用程序链接。有人知道为什么这不再起作用了吗?