看来我无法访问$(this)里面的jquery ajax成功函数。请参阅下面的代码。
$.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();
}
});
如果你不能添加var,因为它被封装在一个函数中,例如:'$('。fileupload')。fileupload({dataType:'json',start:{} ... etc' – Alex 2017-02-16 05:39:59
应该是'$('。fileupload')'?如果是,那么:'var $ t = $('。fileupload')。fileupload(...)' – nickf 2017-02-16 12:15:20
我创建了一个问题:http://stackoverflow.com/questions/42285542/access-this-in-event-jquery-file-upload – Alex 2017-02-16 22:03:23