Dump large array into dropdown list
Hello all,
I'm very new to jQuery and trying to seek a solution for my problem..
I've a large array of nearly 5000 entries and trying to populate those entries into a dropdown list of my webpage. By doing that so, it is taking so much time ( nearly 30 seconds ) and is freezing the page.
Is there any way to load such a big array into dropdown in efficient manner...
var handles = [ ... around 5000 entries .... ];
function populateHandles(){
objSub = document.getElementById('listBox');
for(x=0; x < handles.length; x++){
listOpt = document.createElement("option") ;
listOpt.value = handles[x] ;
listOpt.text = handles[x] ;
objSub.add(listOpt) ;
}
document.forms[0].listBox.options[0].selected=true;
}
Any help is appreciated.
Thanks