简短说明:
我有一个脚本控件,它在脚本文件中处理了单击事件。Click 处理程序弹出确认提示并返回提示的值。
问题:
IE 看到返回 False(在确认框中选择了取消)并且没有回发。Firefox 忽略这一点并触发回发。
解决方案?:
我读到,如果我以老式方式执行此操作,则需要:
onClick="return SomeMethod();"
在标记中。希望有一种方法可以使用脚本控件来做到这一点?
例子:
这是我在脚本文件中的内容:
//THIS IS THE METHOD CLICK CALLS
handleLnkDeleteButtonClick: function(e)
{
var confirmed = confirm('This will delete the current Message category and move all messages to the Oprhan cataegory. Continue?');
return confirmed;
},
initialize: function()
{
this._lnkDeleteButton = $get(this._lnkDeleteButtonID);
this._lnkDeleteButton.idpicker = this;
//HOOK BEGINS HERE
this._lnkDeleteButtonClick = Function.createDelegate(this, this.handleLnkDeleteButtonClick);
$addHandler(this._lnkDeleteButton, "click", this._lnkDeleteButtonClick);
//END HOOK HERE
NDI.WebControls.Client.PersonalMessageTypePicker.callBaseMethod(this, 'initialize');
},
dispose: function()
{
$removeHandler(this._lnkDeleteButton, "click", this._lnkDeleteButtonClick);
NDI.WebControls.Client.PersonalMessageTypePicker.callBaseMethod(this, 'dispose');
}