我有两个页面:一个是主页面,一个是我抓取数据并提交回主页面的弹出窗口。它在 Chrome 和 FF 中似乎可以正常工作,但在 IE 中却不行。我收到一条错误消息“不支持此类接口”。这似乎发生在我要求在 IE 上测试的每个人身上。
我认为这与我将动态行附加到主页的方式有关。我只是不确定我应该如何正确地做这件事。
这是我使用的代码:
function addRowForPC(pcT,pcP)  {
    try {
        var tableID="Equipment"; 
        var table = window.opener.document.getElementById(tableID);              
        var rowCount = table.rows.length - 0;             
        var row = table.insertRow(rowCount);    
        insertFld( "delEquip", "image"   , table, rowCount, row, 0 ) //Image
        insertFld( pcT       , "text"    , table, rowCount, row, 1 ) //Text
        insertFld( pcP       , "textSpan", table, rowCount, row, 2 ) //Text
}
    catch(err) { 
        alert(err.message);
        return "Fail";
    }
}
//This calls: to create the rows:
function insertFld(fldName,fldType,table,rowCount,row,insCell)   {
    try {   
        var cellName = "cell" + (insCell+1);
        cellName = row.insertCell(insCell);
        switch (fldType) {
            case "image":
                        var image = document.createElement('img');
                        image.src="Images/delete.jpg";
                        image.alt ="Remove";
                        image.name=fldName +rowCount;
                        image.setAttribute('width','10');
                        image.setAttribute('height','10');
                        image.onclick= function(){deleteRow(this)}; 
                        cellName.appendChild(image); 
                        break;
            case "text":
                        cellName.innerHTML = fldName;
                        break;
            case "textSpan":
                        cellName.colSpan="2";
                        cellName.innerHTML = fldName;
                        break;
        }
    }
    catch(err) {    
        alert (err.message);
    }
}
任何帮助/指导都会很棒。我是 JavaScript/HTML 的新手,所以我什至不知道从哪里开始 jQuery。
谢谢。