Re: Clear all optgroups and options from a select list
- From: "darwinist" <darwinist@xxxxxxxxx>
- Date: 6 Aug 2006 19:11:59 -0700
Richard Cornford wrote:
darwinist wrote:
RobG wrote:<snip>
darwinist wrote:
darwinist wrote:
<snip>You need an id for the object or a reference to it:
Isn't an optgroup an element that you can remove like
any other?
Yes. Your response was essentially to give every option
an ID, then remove them one by one using getElementById.
That is not a reasonable method given the question.
I said "or a reference to it", and gave commented, working
examples of how to deal with both. What's your problem?
The example you gave was an example that required each optgroup element
to have and ID, that would be the wrong thing to do.
It did not require an ID, it required either an id or a reference,
(which was the first thing i said to the OP). The first actual example
I gave was:
// delete an object by reference
function del(element){element.parentNode.removeChild(element);}
In case no id was present or necessary.
<snip>
For example:
http://darwinist.googlepages.com/htmldesktop.html
Feel free to criticise
You have never actually said what this thing is supposed to be for.
It's to demonstrate all you need to know to start making your own
web-based desktop system, or any subset thereof (a windowed-based
application, for example). It's far from perfect but it includes all
basic functionality required, plus an "immediate" box, and a manual.
It
looks like it is indented to be the bases for an in-browser windowing
system for web-applications. It doesn't look capable enough for any
actual example of such,
Under Help->Examples there are several working examples for making
windows, making objects draggable, a hello world program, etc.
Also the windowing system itself works, as does the desktop.
but I suppose could be extended for specific
applications. However, as it is only really suited for Mozilla/Gecko
browsers as it stands
There isn't any browser-specific code, and although it's not coded to
an apparently well-known ie bug, it's fairly lightweight and quite
responsive in either major browser.
I don't see it being of much practical benefit in
a world where IE support is normally expected (and sometimes
sufficient).
It's meant as a free codebase. I've seen nothing really that does all
desktop-environment stuff in a short, free, clear fashion. Most is
heavy or proprietary, or both, and most try to reinvent the wheel.
or contribute.
You don't appear to be someone who takes advice, so anything approaching
collaboration is out of the question.
I appreciate your advice, even if you don't like what I do with it. I
happen to consider that what "works" is very important. Javsacript
specs are what browsers should implement, but actual browser support is
what programmers need to worry about.
It seems that moving windows around by reference rather than ID would
be a speed improvement and probably slightly less code, so you can
rest-assured my application will reflect this when I next have a play
with it.
I don't respond to authority though. Never have, never will (unless
you're paying me).
Richard.
.
- Follow-Ups:
- Re: Clear all optgroups and options from a select list
- From: Richard Cornford
- Re: Clear all optgroups and options from a select list
- References:
- Clear all optgroups and options from a select list
- From: Brian D
- Re: Clear all optgroups and options from a select list
- From: darwinist
- Re: Clear all optgroups and options from a select list
- From: RobG
- Re: Clear all optgroups and options from a select list
- From: darwinist
- Re: Clear all optgroups and options from a select list
- From: RobG
- Re: Clear all optgroups and options from a select list
- From: darwinist
- Re: Clear all optgroups and options from a select list
- From: Richard Cornford
- Clear all optgroups and options from a select list
- Prev by Date: Memory Leak Problem
- Next by Date: Change image button type problem in IE
- Previous by thread: Re: Clear all optgroups and options from a select list
- Next by thread: Re: Clear all optgroups and options from a select list
- Index(es):