P
Phuff
Am I going crazy? My for loop is incrementing one too far. Never seen
this before. On the test job I'm doing there are 10 items in the
globalData array (index 0-9). How, then, is the index getting to 10?!
Of course I'm getting "undefined" errors because there is nothing at
10!
This would be the same as
for(i=0;i<10;i++)
{
ERROR no index at 10...well duh! I didn't say <=10 I said <10
}
So is this a javascript problem or an IE issue?
Here's the code:
function checkReports()
{
//create the XMLHttp object
for(var j=0;j<globalData.length;j++)
{
var oXmlHttp = createXMLHttp();
var path =
"http://localhost/step1/include/panelDetailsFunctions.asp?checkRep=true"e="+globalData[j].quote+"&unit="+globalData[j].Unit;
oXmlHttp.open("GET", path, true);
oXmlHttp.onreadystatechange = function(){
if (oXmlHttp.readyState == 4){
var data =oXmlHttp.responseText;
var div =
document.getElementById("repErr-"+globalData[j].Unit);
//div.innerHTML = data;
alert(data);
}
};
oXmlHttp.send(null);
}
}
this before. On the test job I'm doing there are 10 items in the
globalData array (index 0-9). How, then, is the index getting to 10?!
Of course I'm getting "undefined" errors because there is nothing at
10!
This would be the same as
for(i=0;i<10;i++)
{
ERROR no index at 10...well duh! I didn't say <=10 I said <10
}
So is this a javascript problem or an IE issue?
Here's the code:
function checkReports()
{
//create the XMLHttp object
for(var j=0;j<globalData.length;j++)
{
var oXmlHttp = createXMLHttp();
var path =
"http://localhost/step1/include/panelDetailsFunctions.asp?checkRep=true"e="+globalData[j].quote+"&unit="+globalData[j].Unit;
oXmlHttp.open("GET", path, true);
oXmlHttp.onreadystatechange = function(){
if (oXmlHttp.readyState == 4){
var data =oXmlHttp.responseText;
var div =
document.getElementById("repErr-"+globalData[j].Unit);
//div.innerHTML = data;
alert(data);
}
};
oXmlHttp.send(null);
}
}