【发布时间】:2017-07-08 12:24:20
【问题描述】:
我在主页中有一个 ASP 下拉列表。当我单击一个按钮时,会出现一个带有列表数据的弹出窗口。当我单击一行时,我会从表格行中提取必要的值,并将其设置为主页中的下拉菜单。
//This chunk of code is the action when user click the table row in the Pop Up.
//Access the Drop Down element from Main Page from this Pop Up Page
var InternalOrderDDL = window.opener.document.getElementById("ctl00_MainContent_InternalOrderDDL" + rowID);
//Clear all item in this Drop Down
InternalOrderDDL.options.length = 0;
//Add elements to this Drop Down
AddOption("--", "", InternalOrderDDL);
AddOption(text, value, InternalOrderDDL);
function AddOption(text, value, element) {
var option = document.createElement("option");
element.options.add(option); // Google Chrome works very well but IE has an error "Unspecified error" when hit this line.
option.value = value;
option.innerHTML = text;
}
基本上,在 Google Chrome 中一切正常,但 Internet Explorer 存在此问题。
是弹窗的原因吗?
【问题讨论】:
标签: javascript c# html asp.net internet-explorer