...

View Full Version : Error: uncaught exception:



NancyJ
09-27-2005, 11:26 AM
Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)" location: "*** Line: 30"]

my js works fine but I get this message in my javascript console - is it anything to worry about?

line 30 is :

for(i = 0;i< counter; i++){

the function is

function setCosts(){
band = 0;
var country = document.addform.ShipCountryID.options[document.addform.ShipCountryID.selectedIndex].value;
for(i = 0;i< counter; i++){
if (arrCountryIDs[i] == country){
alert("match");
band = arrBands[i];
}
}
delivery = 0;
for(i=0;i<numprods;i++){
delivery = delivery + eval('arrBand'+band)[i];

}
document.addform.delivery.value = delivery;
//document.addform.total.value = formatCurrency(arrCosts[i]+subtotal);

}

rm-f
09-27-2005, 03:01 PM
Where do you set counter?

NancyJ
09-27-2005, 03:05 PM
in a different function

..cant post the whole thing, its dynamically generated and is huge

counter = arrCountryIDs.push(17.5);

rm-f
10-09-2005, 02:21 AM
chech the counter value prior to line 30:

alert(counter);
for(i = 0;i< counter; i++){


the code:
counter = arrCountryIDs.push(17.5);
is unusual (?)

should it be (?):
counter = arrCountryIDs.length

Also it could be a Mozilla bug, check their site:
http://bugzilla.mozilla.org



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum