my getJSON code doesn't work in jquery 1.4.2
- by Nikolius
This is my first question on stackoverflow. I just wonder why my getJSON code doesn't work with jQuery 1.4.2, it worked smoothly with jQuery 1.3.2 though
So here is my code
$(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.');
}
}
The getJSON link is a CodeIgniter App Link. Anyone know why this doesn't work anymore?