Reputation: 12695
I send to the javascript an array like:
$.each(data, function (value, name) {
$('#visitStart').append($('<option></option>').val(value).html(value));
});
and as a result I see that the visitStart input is filled by values from 0 to 241. Why ?
Upvotes: 1
Views: 224
Reputation: 222168
$.each sends an index, and value into the callback function - http://api.jquery.com/jQuery.each/
$.each(data, function (i, obj) {
$('#visitStart').append($('<option></option>').val(obj.value).html(obj.value));
});
Upvotes: 6