[Javascript] IE work-a-round question (re: checkboxes)

Troy III Ajnej trojani2000 at hotmail.com
Wed Apr 16 00:02:07 CDT 2008


Yeah, so was the IE, direct element refferencing, a decade older than
W3C document.getElementById(MyElement).style.something.
It was more readable, more easy, more flexy, more reliable, more everything...
by simply stating: MyElement.style.smashIt, but what happened?
 
tell Tedd who was holding back the WEB. 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                        Troy III                            progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



> From: david at dorward.me.uk> To: javascript at lists.evolt.org> Date: Sat, 12 Apr 2008 16:39:27 +0100> Subject: Re: [Javascript] IE work-a-round question (re: checkboxes)> > > On 12 Apr 2008, at 16:34, Claude Schneegans wrote:> >> > But what's the big idea of breaking a string into its character in > > order> > to make a string with them?> > It is a quick and easy way to get at the characters you want from the > string.> > > Especially if those characters are "1" and "1"> > If id[2] and id[3] are "1"s, the expression might very well end into > > "2"> > (addition) instead of "11" (concatenation).> > Only if there is a bug in the JavaScript engine. The data type is > string, you'd have to do something that converted it to a number > before that would happen.> > >>> "123"[1] + "123"[2]> "23"> > > If you need to extract chars 2 and 3 out of the string id, better use> > the substr() method:> > id2 = "c" + id.substr(2,2);> > > For the sake of IE, this is true, but treating the string as a > character array can result in more readable code.> > -- > David Dorward> http://dorward.me.uk/> http://blog.dorward.me.uk/> > > _______________________________________________> Javascript mailing list> Javascript at lists.evolt.org> http://lists.evolt.org/mailman/listinfo/javascript
_________________________________________________________________
Pack up or back up–use SkyDrive to transfer files or keep extra copies. Learn how.
http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20080416/4eeafa39/attachment.htm>


More information about the Javascript mailing list