[BNM] innerHTML
Chris Korhonen
ckorhonen at gmail.com
Mon Aug 6 11:29:50 BST 2007
I always find that innerHTML is better for performance - so if you are
whacking a mass of HTML into a <div> then innerHTML is probably the best way
forward.
The DOM methods, whilst being the 'proper' way to do things are often
horribly slow when you try and use them to append more complex chunks of
HTML. Whenever I use them, I also seem to run into more browser
incompatibilties, especially when appending to a <select> element or a
table..
If you want to simplify the DOM methods, and take care of all of the cross
browser stuff then I'd suggest you look toward a JavaScript framework such
as MooTools.... which simplifies element creation.
Chris
On 8/6/07, Patrick Heath <pat at i-tools.co.uk> wrote:
>
> innerHTML
>
>
>
> is it ok to use this for appending html to a page or better to stick to
> DOM
> methods?
>
>
>
> Any good tools to simplify the latter?
>
>
>
> Also anyone using JSON for the AJAX response rather than xml for large
> bits
> of data, any performance advantages?
>
>
>
> Cheers
>
>
>
> Pat.
>
>
>
>
>
>
>
>
> _____
>
> I am using the free version of SPAMfighter for private users.
> It has removed 1467 spam emails to date.
> Paying users do not have this message in their emails.
> Try SPAMfighter <http://www.spamfighter.com/len> for free now!
>
> --
>
> BNM Subscribe/Unsubscribe:
> http://www.brightonnewmedia.org/options/bnmlist
>
> BNM info/archives:
> http://www.brightonnewmedia.org/
>
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com
>
More information about the BNMlist
mailing list. Powered by Wessex Networks