PDA

View Full Version : JavaScript for loop won't work



Asperamanca
15th October 2010, 21:16
The following code results in the error
Unexpected token `for'

I'm not a JavaScript expert, but it looks valid to me:



for (i=1;i<=10;i++)
{
// Do something
}

wysota
15th October 2010, 21:58
Is this the whole script?

Asperamanca
15th October 2010, 22:23
My bad. From what I've heard on the DevDays, I just assumed that I could mix JavaScript and QML as I wanted. Wrapping it with a function does the trick.