[英]table.rows.length not working in mozilla firefox but working in google chrome
var otable, orow, ocol;
otable = eval(document.all.tabmenu);
for(var ictr=otable.rows.length-1;ictr>=0;ictr--) --> error
otable.deleteRow(ictr);
There is an classic asp project in which a javascript functionand is creating two hyperlinks (add,delete). 有一个经典的asp项目,其中有一个javascript函数,并且正在创建两个超链接(添加,删除)。 tabmenu is a table, while in google chrome when i debug then otable.rows.length = 2 which is working fine but unfortunately in firefox otable.rows.length = 0 , i am not able to understand it.
tabmenu是一个表,当我在谷歌浏览器中调试时,otable.rows.length = 2可以正常工作,但是不幸的是,在Firefox otable.rows.length = 0中,我无法理解。 Need help!!
需要帮忙!!
There's not document.all
collection in FF. FF中没有
document.all
集合。 Instead of eval(document.all.tabmenu)
use document.getElementById('tabmenu')
, which will work in any browser. 代替
eval(document.all.tabmenu)
使用document.getElementById('tabmenu')
,它将在任何浏览器中运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.