我的javascript代码可以在ie, chrome和safari上工作,但是它不能在firefox上工作。我检查了可能的解决方案,但没有一个可行。火狐仍然显示窗口。事件定义。
Javascriptfunction OnChooseItem(type, id, src) {
window.event.cancelBubble = true;
if (selectedView == "TileView") {
if (selectedItem != void (0)) {
selectedItem.className = "ExplorerItem";
selectedItem._selected = false;
}
var event = src || window.event
selectedItem = (event.target || event.srcElement).value;
top.frames["OptionCallbackFrame"].MakeCallback(type, id);
while (selectedItem.parentPanel == void (0)) {
selectedItem = selectedItem.parentElement;
}
selectedItem._selected = true;
selectedItem.className = "ExplorerItemHover";
} else {
if (selectedItem != void (0)) {
selectedItem.className = selectedItem.__className;
}
selectedItem = src;
selectedItem.className = "DataGridItemMarked";
top.frames["OptionCallbackFrame"].MakeCallback(type, id);
}
服务器端
panel.Attributes.Add("onclick", "OnChooseItem(" + Numbers.GetSafeValue(dataReader["TYPE"]) + ", '" + Strings.GetSafeValue(dataReader["DOCUMENT_ID"]) + "', this)");
尝试使用传入的参数获取事件:
var aVar = {
anExample: function(event){
var evnt = event || window.event
}
}