help asp.net/javascript

ruijorge

Member
May 12, 2006
53
0
0
Hi,

I have a javascript function that works just fine in IE but it doesn't work in Firefox.
In fact it´s only a part of the function that doesn't work, this line to be more precise:

-> grid.rows(rowCount).cells(0).innerText

I am trying to get the value of each row at cell(0) from a GridView control:
(var grid = document.getElementById("<%=GridView1.ClientId%>");)

As I said this works perfectly in IE..

Help please!!
Thanks.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
I haven't done any work with ASP.NET yet, but have you tried a View Source in Firefox to see how the grid is being rendered for it?

Also, Google can tell you whether getElementById is supported by firefox, and what to use instead if it's not.
 

NanoStuff

Banned
Mar 23, 2006
2,981
1
0
The Firefox DOM inserts textNode nodes for whitespace, this may be your problem. Try removing whitespaces from the code structure in the table, or perhaps rowCount(value+1), and/or cells(value+1) might work. It's probably best to use a framework to avoid these problems.
 

KB

Diamond Member
Nov 8, 1999
5,406
389
126
You can use innerHTML which will work in both browsers.
 

ruijorge

Member
May 12, 2006
53
0
0
Thanks guys !

Great tip on Firebug!! :)

I solved my problem, it wasn't very difficult.
I used this 'grid.rows[rowCount].cells[0].innerHTML' and now it works on both browsers!