News for hackers. Stuff that matters.
Re:Advanced JavaScript Techniques by axod on Friday October 09, 2009 @03:09PM (#872219)
That's true for IE, but not for good browsers. For firefox/safari/chrome it's negligable difference if not sometimes slightly faster to use the DOM methods.

Also, using DOM methods allows you to easier attach listeners, save references to DOM elements for later updates/use etc. That means less getElementById()'s later.

Writing HTML inside js code is just horrible (IMHO). Horrible ugly code. And obviously easier to have security issues if you're including non-sanitized user data.

#6 is a horrible idea.

As far as your JS code is concerned, HTML is a (horrible, ugly) serialization of the DOM. Manipulate the DOM programatically. Don't use HTML.

Re:Advanced JavaScript Techniques by jedediah on Saturday October 10, 2009 @02:35AM (#873046)
Sadly, most of us have to code for IE, just as we have to code for the "good browsers".
Re:Advanced JavaScript Techniques by axod on Saturday October 10, 2009 @04:04AM (#873107)
If you're in the 'webapp' area, where IE is a minority (20% or so), I think it's justifiable to program in a clean way and live with IE users having a slower experience.

innerHTML is just the worst thing ever invented. Ugly ugly thing.

Re:Advanced JavaScript Techniques by JeffJenkins on Saturday October 10, 2009 @10:26AM (#873338)
Where does that 20% stat come from?