Reputation: 16671
Code:
for(int j=0; j<virtualFields.length();j++)
{
finalOptions += '<option value="'+virtualFields[j]+'"><\/option>' ;
}
Firebug is giving this error:
Missing ; after for loop initializer.
Upvotes: 1
Views: 180
Reputation: 490607
You are using int
to declare a variable.
Use var
instead.
Also, if virtualFields
is an Array
, you should just be accessing the length
property, not as a method.
Upvotes: -1
Reputation: 5262
Javascript doesn't understand int
. Use var
instead.
Some other pointers:
virtualFields
is an ordinary array, length
is a property, not a method.virtualFields[j]
values that you're concatenating like that./
inside a regular expression, not within an ordinary string. So </option>
would work just fine.(these points are not related to the error, but you may wish to take them into account anyway)
Upvotes: 9