function getRFPercent(rf) {
alert('calc');
//return (parseInt(rf)-1)/parseInt(rf);
}
function extract() {
var techinfo, rflist, rfs, rf;
techinfo = document.getElementById('techinfo');
rflist = techinfo.firstChild.childNodes[1].childNodes[1];
rfs = rflist.getElementsByTagName('span');
for (rf in rfs) {
alert('callfnc');
//rf.innerHTML = getRFPercent(rf.innerHTML)
}
}
function callRFCalc() {
extract();
}
callRFCalc();
Causing the error: Cannot read property 'childNodes' of undefined
This is the HTML Code where i want to navigate through
<div id="techinfo">
<div class="techwrapper">
<div class="leftcol">
blabla
</div>
<div class="rightcol">
<p>bla</p>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
<table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td colspan="2">blabla</td>
</tr>
</tbody>
</table>
<div id="bl0" style="display: none; ">
<table class="titt" width="100%">
<tbody>
<tr>
<td>bla</td>
<td align="right" class="white">bla</td>
</tr>
</tbody>
</table>
</div>
<div id="bl1" style="display: none; ">
blabla
</div>
</div><!-- rightcol -->
<br class="clearfloat">
</div><!-- techwrapper -->
</div>What i'm trying to get is the <ul><li>-stuff.
I'd like to modify the text in those <li>'s and i dont know why im getting that error.
Side-Info: It's an Userscript(.org)
Does anybody know what i'm doing wrong?
cheers
This post has been edited by Toxicterror: 18 July 2012 - 08:24 AM

New Topic/Question
Reply


MultiQuote




|