Dường như tôi không thể truy cập $ (this) bên trong hàm thành công jquery ajax. xin vui lòng xem mã dưới đây.
$.ajax({
type: 'post',
url: '<?php echo site_url('user/accept_deny_friendship_request')?>',
data: 'action='+$action+'&user_id='+$user_id,
success: function(response){
//cannot access $(this) here $(this).parent().remove();
}
});
nếu bạn không thể thêm var vì nó được bao bọc trong một hàm như: '$ ('. Fileupload') .pileupload ({dataType: 'json', start: {} ... etc' – Alex
do đó nó nên là '$ ('. fileupload')'? Nếu vậy, sau đó: 'var $ t = $ ('. fileupload'). fileupload (...)' – nickf
tôi đã tạo một câu hỏi: http://stackoverflow.com/question/42285542/access-this-in-event-jquery-file-upload – Alex