[thelist] dynamic javascript loop help

Joshua Olson joshua at waetech.com
Tue Jan 18 15:19:26 CST 2005


> -----Original Message-----
> From: Hassan Schroeder
> Sent: Tuesday, January 18, 2005 1:11 PM
> 
> Joshua Olson wrote:
> 
> > document.getElementById('row_'+a+'_col_'+f).innerHTML;
> /
> > Caveat: Untested code, and innerHTML is not standards compliant [0].
> > Perhaps we could use innerText instead?
> 
> Better yet, why not get 'value here' from this:
> 
>     <td id='row_0_col_0'>value here</td>
> 
> :: with this:
> 
> document.getElementById('row_'+a+'_col_'+f).firstChild.nodeValue

Hassan,

Try this in IE and Moz:

<div id="test">
This is the sentence<span>, in full</span>.
</div>
<script>
alert(document.getElementById('test').firstChild.nodeValue);
alert(document.getElementById('test').innerHTML);
alert(document.getElementById('test').innerText);
</script>

What do you get?  I suppose it would be helpful to know what sort of data we
expect within the table cell.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168 




More information about the thelist mailing list