XML Feeds

.

[javascript-dev] Re: RE: JSUI : question about Array index/value

Emmanuel Jourdan c74-mailinglists at e--j.com
Wed Oct 3 08:59:30 MDT 2007


On 3 oct. 07, at 16:46, simon adcock wrote:

> That's odd. Just incase you're looking at the forum view not the  
> email list here's the js code again with out the bits missing...  ?!
>
> var Ratio = ["1:1", "2:1", "3:1","4:1", "6:1", "10:1"];
>
> function ratio(a)
> {
>   for(i=0; i<Ratio.length; i++)
>   {
>     if(Ratio[i] == a)
>     {
>       outlet(0, i);
>     }
>   }
> }

One small thing, don't forget to declare the "i" variable with the  
var keyword, otherwise it becomes global.

ej




More information about the javascript-dev mailing list