[Javascript] Apply padding via javascript

Troy III Ajnej trojani2000 at hotmail.com
Sat Aug 19 21:16:01 CDT 2006


Yes, that would be my preferred way also.
 
Although I think this is the same bull differently packed and "borrowed" from first release of IE 4.0.
This is a call of element extracted from document members, the same mistake IE4.0 did.
 
The argument:
Now why do I like your approach more, than:             document.getElementById("MyBlock").style.padding = ...;
of course, only if: 
             var oDiv = document.getElementById("MyBlock");
is declared as global variable. Otherwise there is no benefit!
 
That's because every time the script calls the object, the browser has to iterate through all document objects once again.
But this inefficiency/mistake was immediately corrected before the end of 1997.[with IE4.01 patch].
Even if you could, -back then, also declare:
             var oDiv=document.all.MyBlock;
to later use:
             oDiv.style.something...;
compensating for document collection call overhead. 
But seeing that this is now inefficient for coders, they've immediately introduced
the direct object reference. 
             MyBlock.style.something...;
Something W3C never did! -I wonder why?!
 
For your eyes only:
But no need to wonder, because as "object call through collection" , -the direct object reference might still be, at least 
an "Intellectual Property" of Microsoft. But this one is not that easy to modify so W3C left it out until at least next year.
Because (I'm not very sure about this) but Intellectual property rights expire in a decade.
 
"object reference" method  in W3C standard, yes, that would be the day.
 
Regards.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                         Troy III                           progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



> Sorry for not answering your question as stated, but I like the third option:> >          var oDiv = document.getElementById("MyBlock");>          oDiv.style.padding = ...> > Paul  > > _______________________________________________> Javascript mailing list> Javascript at LaTech.edu> https://lists.LaTech.edu/mailman/listinfo/javascript
_________________________________________________________________
Try Live.com: where your online world comes together - with news, sports, weather, and much more.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060820/59f18e7d/attachment.htm>


More information about the Javascript mailing list