Hey there, Well essentially injecting markup is, currently, a snake pit.
If you look into the code for the equivalent features of major frameworks (jQuery's html(…), Prototype's update/replace(…), etc.) you'll find that they need to implement a number of workarounds depending on the kind of markup you're trying to inject.
The main rationale is: whenever non-buggy, use innerHTML as it's going to be *blazingly faster* than DOM building.
However, several situations (mostly related to attributes in <a> tags and, as always, table-related tags) are improperly handled by innerHTML= implementations of a variety of browsers (generally IE), so manual DOM building is required.
Ironing out this sort of discrepancies is exactly the kind of things that frameworks should do for you, as a "common ground".
-- Christophe Porteneuve [email protected] -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
