A
Aaron
Hi there,
I'm attempting to loop through a very simple array of the form:
["colour", "second value"]
I am using:
for (var i = 0; i < result.length; i++) {
options += '<option value="' + result + '">' + result + '</option>';
}
with the idea that options is written to a select box.
An example page is at: http://test-psi-alpha.appspot.com/jquery3
The problem is as follows:
result seems to be treated as a string instead of an array because result.length gives the number of characters as if it were a string and the loop loops through each character.
Any clues on how to solve this beast would be appreciated.
Aaron
I'm attempting to loop through a very simple array of the form:
["colour", "second value"]
I am using:
for (var i = 0; i < result.length; i++) {
options += '<option value="' + result + '">' + result + '</option>';
}
with the idea that options is written to a select box.
An example page is at: http://test-psi-alpha.appspot.com/jquery3
The problem is as follows:
result seems to be treated as a string instead of an array because result.length gives the number of characters as if it were a string and the loop loops through each character.
Any clues on how to solve this beast would be appreciated.
Aaron