Hey all,
I'm attempting to repopulate a drop down menu. I'm making an ajax call to retrieve myList. When I have the new list, I remove all the options from the select element and insert the new values (about 100 options). This works great on later versions of IE and Firefox; the refresh is almost instant. However, on IE6, these operations really slow the browser down. The dropdown box almost becomes animated as options are removed from it, and this goes on for several seconds. Is there any way to speed this up outside of comparing the old list to the new one and only removing/adding the items that have changed?
$("#myselect").children.remove();
$.each(myList, function(i, val) {
$("<option>").attr("value", val.myID)
.text(val.myText)
.appendTo("#myselect");
});