I have a <selectthat I build up dynamically. To later clear and
repopulate it, I can't use the standard trick of:
ptr_to_select.o ptions.length = 0;
because sometimes the <selectwill contain <optgroup>s. These stay in
the <select(for Firefox and IE7, not Safari), after setting the length
to zero.
What seems to work on all browsers is:
while (ptr_to_select. childNodes.leng th>0)
{
ptr_to_select.r emoveChild (popup.lastChil d);
}
but, are the removed children properly garbage collected? Especially as
some will be the <optgroup>s and have children themselves.
repopulate it, I can't use the standard trick of:
ptr_to_select.o ptions.length = 0;
because sometimes the <selectwill contain <optgroup>s. These stay in
the <select(for Firefox and IE7, not Safari), after setting the length
to zero.
What seems to work on all browsers is:
while (ptr_to_select. childNodes.leng th>0)
{
ptr_to_select.r emoveChild (popup.lastChil d);
}
but, are the removed children properly garbage collected? Especially as
some will be the <optgroup>s and have children themselves.
Comment