PDA

View Full Version : Clearing a large listbox quickly using javascript


k89mmk
11-19-2004, 09:49 AM
I've got a listbox that gets populated with a lot of entries (server side). These entries get saved into a javascript array and then the listbox is cleared out (client side). Right now the code that does this is:

document.form1.listboxname.options.length=0;

But this one line causes a 4-5 second delay on each page load (I guess because there are a lot of entries in the list box). Does anyone know this could be done faster?

Thanks.