Jquery 通知实施,从当前范围外引用$(this)
我是jQuery和web开发的超级高手,需要一些帮助来实现apprise警报系统。我意识到“verify”函数中的函数不识别“this”选择器,我应该实现$.proxy以从当前范围之外获取“this”选择器。但不管我怎么努力,我都无法让它发挥作用Jquery 通知实施,从当前范围外引用$(this),jquery,scope,this,Jquery,Scope,This,我是jQuery和web开发的超级高手,需要一些帮助来实现apprise警报系统。我意识到“verify”函数中的函数不识别“this”选择器,我应该实现$.proxy以从当前范围之外获取“this”选择器。但不管我怎么努力,我都无法让它发挥作用 $('.closebtn').click(function(){ apprise('<center>Are you sure you want to delete this section?<br>Th
$('.closebtn').click(function(){
apprise('<center>Are you sure you want to delete this section?<br>This action can not be undone!</center>',{'verify':true}, function(r){
if(r){
$(this).remove();
}
})
})
$('.closebtn')。单击(函数(){
通知('是否确实要删除此节?
此操作无法撤消!',{'verify':true},函数(r){
if(r){
$(this.remove();
}
})
})
提前感谢您提供的任何帮助简单,存储
此
$('.closebtn').click(function(){
var $button = $(this);
apprise(...., function(r){
if (r){
// re-reference it
$button.remove();
}
});
});
您可能会看到javascript中的“类”也做了类似的事情(通常命名为self
)。e、 g
简单,存储
此
$('.closebtn').click(function(){
var $button = $(this);
apprise(...., function(r){
if (r){
// re-reference it
$button.remove();
}
});
});
您可能会看到javascript中的“类”也做了类似的事情(通常命名为self
)。e、 g
谢谢你的帮助。我试过了,但没用,我觉得我疯了。但实际上,mouseleave上包含了更多的代码,当我将鼠标指针移动到apprise弹出窗口时,它正在删除click事件处理程序……thx用于确认我可以将“this”存储到thoThx之类的变量中以获得帮助。我试过了,但没用,我觉得我疯了。但实际上,mouseleave上包含了更多的代码,当我将鼠标指针移动到apprise弹出窗口时,它正在删除click事件处理程序……thx用于确认我可以将“this”存储到类似于tho的变量中