所以我有一个从父窗口打开的子窗口按钮的 JavaScript 代码 onclick。
try{
window.opener.item(23,Add,document.AddEdit.name.value,document.AddEdit.type.value);
} catch(err){
alert('The form you are editing is not available.');
}
父窗口中的item
函数 -
function item(id,action,name,type){
saveScroll();
document.abc.itemId.value = id;
document.abc.itemAction.value = action;
document.abc.itemName.value = name;
document.abc.itemType.value = type;
document.abc.submit();
}
所以不知何故,我从 catch
block 中收到错误。但这种情况只发生在IE9中,在firefox、IE8、chrome中完美运行。所以错误是“未找到成员”。有人在 IE9 中遇到过这个问题吗?
最佳答案
我不确定,因为我没有 IE,但你是否尝试过像这样声明“item”:-
var item = function(id, action, name, type) {
//etc
}
我尝试的另一件事是将“item”重命名为其他名称,以防出现名称冲突......
关于javascript - 单击按钮后 IE9 中的子窗口将关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6768251/