javascript - 单击按钮后 IE9 中的子窗口将关闭

标签 javascript internet-explorer-9

所以我有一个从父窗口打开的子窗口按钮的 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/

相关文章:

javascript - React Native 视频无法播放本地文件

javascript - 用动态文本和动态大小填充多边形

html - Umbraco 不渲染 IE 框阴影

jquery - getJSON 或 AJAX 请求不适用于 IE9

html - Internet Explorer 9制作不该有的线和框

javascript - FadeOut 结束然后做点什么

javascript - 使用纯 Javascript 对象作为 Ember 模型

javascript - 在哪里引用 Ionic 的 template/[xxx].html 的 JavaScript 文件

css - IE9 过滤器阴影错误?

css - rgba 背景与 IE 过滤器替代 : IE9 renders both!