![]() Preserved Topic: JavaScript Array Length detection (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Manchester |
![]() Hello, |
Bipolar (III) Inmate From: dk's house of love |
![]() code: if(myarray.length > 4)
|
Bipolar (III) Inmate From: Manchester |
![]() I know I have tried that, but it does not return the correct array length. It is probably something I am doing wrong. The array I am reading the length from is added to by a for loop but I am pretty sure that it is not in-accurate. |
Paranoid (IV) Inmate From: A graveyard of dreams |
![]() Would be easier if you gave us a link to were the problem is |
Bipolar (III) Inmate From: Manchester |
![]() I have figured it out now. I was being soo stupid. The array I was reading from got added to by a function which took the element number from the onClick event. So for example if the element number assigned to the particular onClick event was 23 then it made the array length 23! So even though I had only added 4 peices of data it made the array length 23. :-) |