简体   繁体   English

table.rows.length在mozilla firefox中不起作用,但在Google Chrome中起作用

[英]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.

相关问题 table.rows.length在IE11中不起作用 - table.rows.length is not working in IE11 网站滑块在Google Chrome和Mozilla firefox上不起作用 - website slider is not working on Google Chrome and Mozilla firefox Java代码可在Mozilla Firefox中运行,但不能在Google Chrome中运行 - Javascript code working in Mozilla Firefox but not in Google Chrome 为什么我的扩展程序在 Mozilla Firefox 上运行而不是在 Google Chrome 上运行? - Why is my extension working on Mozilla Firefox and not on Google Chrome? 为什么Cut,Copy,Paste在Mozilla Firefox和Google Chrome浏览器中不起作用? - why Cut,Copy,Paste is not working in Mozilla Firefox and Google Chrome browser? Window.close(); 在Chrome和Mozilla Firefox中无法使用 - The Window.close(); is not working in Chrome and Mozilla Firefox 验证不适用于Mozilla,但适用于Google Chrome - Validation is not working in Mozilla but working in Google Chrome 代码块在 mozilla firefox 中工作,但在 Chrome 中不工作 - Code block working in mozilla firefox but not in Chrome 删除无法使用的动态表格,可以在Chrome中使用,但不能在Mozilla中使用 - Delete not working Dynamic table working in chrome but not in mozilla 后退按钮在Internet Explorer中不起作用,在mozilla firefox和google chrome中工作良好 - back button not working in internet explorer, working good in mozilla firefox and google chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM