0

我使用 flowplayer 来显示视频。它适用于 Firefox 和 chrome。但它在 iexplorer 中不起作用。给我的错误是:

SCRIPT5007:无法获取属性“innerHTML”的值:document.getElementById(src_row).innerHTML 的对象为 null 或未定义。“src_row”是有价值的,但innerHTML 是没有价值的。

函数附在下面。请帮助如何使用 ie 使其工作。谢谢

function copyRows(dest_row, src_row_id){
    var src_row = 'row' + src_row_id.toString(); 
    document.getElementById(dest_row).innerHTML = document.getElementById(src_row).innerHTML;
}
4

2 回答 2

0

您在通话中指的是src_rowgetElementById但似乎您ID在调用它之前正在修改它。

var src_row = 'row' + src_row_id.toString(); 
document.getElementById(src_row)

假设这样的电话:

copyRows( myRow, 'rowID' );

getElementById(src_row)将寻找带有IDof的元素rowrowID

这是你的意图吗?将“行”附加到 ID 的开头?

于 2012-10-30T17:35:08.380 回答
-1
function copyRows(dest_row, src_row_id){
    var src_row = 'row' + src_row_id.toString(); 
    console.log(src_row);
    document.getElementById(dest_row).innerHTML = document.getElementById(src_row).innerHTML;
}

看看这是否为您提供了您正在寻找的字符串。

于 2012-10-30T17:39:15.187 回答