+ Start a Discussion
AFawcett (CODA)AFawcett (CODA) 

Summer'09 gotcha, ensure you have best practice around Array in JavaScript in your code

If you are using the JavaScript Array object in script within your page be sure to check that your correctly iterating over the items within it. If your using for(key in myarray) as apposed to for(var i=0; i<myarray.length;i++) your code will find it is all of sudden finding some some new items in the array! ;-) This article explains the situation and solution pretty well, it's basically down to the fact that the afore mentioned approach is bad practice over the use of Arrays, http://andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/.