[OT] javascript guru out there?

Konstantin Svist fry.kun at gmail.com
Thu Jul 22 18:01:17 UTC 2010


  On 07/22/2010 10:50 AM, Mike Wright wrote:
> Hi all,
>
> Sorry to post this here but of all the lists/forums I'm on this one
> seems to have the most diverse talent pool.
>
> I've been developing a javascript application that works everywhere
> except on Google's Chrome browser and have tracked it down to a "for
> each" statement.  To verify that's what it is I created a tiny example
> program and sure enough that one also fails.  Upgraded Chrome to the
> latest stable version and the failure persists.
>
> If anybody wants to take a peek/stab at this I could sure use the help -
> I've been stumped on this for two days now.
>
>           http://www.pastebin.com/Pq5E8Tfe
>
> Thanks for any and all help,
> Mike Wright
>

Running a for on a list in JS is asking for trouble. One of the list 
elements is .length, so it won't do what you want it to in at least one 
of the cases. Maybe Chrome is blocking it on purpose.
Instead, use for (var y=0; y<x.length; y++)
Or you can reverse the loop if you need to optimize it for (var  
y=x.length; y>=0; y--)




More information about the users mailing list