SV: [thelist] JavaScript: How to save/return state on group of objects
Tom Dell'Aringa
pixelmech at yahoo.com
Fri Nov 14 07:43:10 CST 2003
--- Marcus Andersson <marcan at home.se> wrote:
> Well, arrays can be quite handy.
>
> >I can almost see Marcus now typing up an OO answer...;)
>
> I could, if you want...
> But, even if you create an OO solution to this there will in the
> end (hidden somewhere in the OO stuff) be an array :). And I also
> guess that OO shouldn't be used everywhere. Your script is pretty
> small and simple and I think it would make it a little bit more
> complex if you make it OO (not very much though). But, if you're
> going to use it all over the place I would definitely make it a
> class somehow.
Great, and I was semi-saying that tongue in cheek anyway. I hate how
email distills all my good humour. Oh well. This is pretty much a one
shot deal at the moment so simple is good.
> >http://www.pixelmech.com/review/newWorkerTable.html
>
> Hmmm... It doesn't work. Everything gets green. A change on row 84
> to: oCells[i].style.backgroundColor = ""; made it work
Gah! I can't believe it was that simple and I didn't know that! Yes,
the problem indeed was that everything was green - thus my post ;) -,
because nothing was changing back, but that line works perfectly.
> Yeay, I know it's kind of ugly and not completely DOMish to "reset"
> an attribute like that, but all (not many at all according to PPK
> and his quirksmode) browsers doesn't support removal of attributes.
> And it works ;)
Ugly - don't care. Not DOMish, don't care. Works - that I care about!
If there were a *reliable* DOM way to do it I'd be all for it but I'm
not going to shed any tears over it!
Thanks!
Tom
=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: JavaScript Author / Every Friday!
http://www.thywordistruth.net/ :: Eternal Life
"I'll ho ho and ha ha you!" (Daffy Duck)
More information about the thelist
mailing list