PDA

View Full Version : Bug in Moz? Or am I just...



Zvona
Jun 25th, 2002, 12:15 PM
Following scripts works on IE6 just as meant. However, Mozilla 1.0RC3 returns an error "aDevices is not defines". aDevices is a global variable.

I added an extra alert to determine whether error is correct.

window.onload = function()
{
alert(aDevices.length);
document.open();
document.write("<table border='1'><thead><tr><th align=left>Name</th><th>Type</th><th>IP-Address</th><th># Polls</th></tr></thead><tbody>");
for (var iA=0; iA < aDevices.length ;iA++)
{
document.write("<tr><td>"+ aDevices[iA].dispName +sCell+ aDevices[iA].pollType +sCell+ aDevices[iA].ip +sCell+ aDevices[iA].pollCount +"</td></tr>");
}
document.write("</tbody></table>");
document.close()
}
blue row alerts 9.
red row is the row that returns error.

joh6nn
Jun 25th, 2002, 01:31 PM
i agree with Dave. if you put that alert after the document.open() line, i'm betting you'll get undefined.

Zvona
Jun 25th, 2002, 01:51 PM
Correct. And now that I think, it's obvious :D