I am trying to bind drop-down through global variable (names is the array name) which binds fine below:
Click here - dropdown is populating fine
var name = ['us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya', 'us', 'china', 'kenya'];
But when i try to populate the array (ddList is the array name) in the success call back function(fnsuccesscallback), drop-down is NOT populating.
Click here - drop-down is not pupulating
function fnsuccesscallback(data) {
$.each(data.d, function () {
ddList.push(this['Value']);
});
ddList.push('a');
ddList.push('b');
ddList.push('c');
ddList.push('d');
}
But i want to populate the array in call back function only.
Could you please let me know how to fix this?
updated:
Getting data but formating of dropdown is screwed up