doing what i said i got these results on ie6:
Moo: 6844ms
Moo set('html', ''): 172ms
DOM: 610ms
innerHTML: 172ms
IE7:
Moo: 3188ms
Moo set('html', ''): 125ms
DOM: 531ms
innerHTML: 125ms
IE8:
Moo: 4453ms
Moo set('html', ''): 93ms
DOM: 453ms
innerHTML: 63ms
Fábio Miranda Costa
Engenheiro de Computação
http://meiocodigo.com
2009/6/17 Fábio Costa <[email protected]>
> You might know that you cant use innerHtml with table elements and its
> internals (tbody, td, tr...) thats why mootools did this html property, to
> fix this issue.
>
> To have the best speed you will have to construct a string just like you
> did on your 'innerHTML' test, including the table element and setting the
> html property of a div or whatever container you want the table in.
>
>
> Fábio Miranda Costa
> Engenheiro de Computação
> http://meiocodigo.com
>
>
> On Wed, Jun 17, 2009 at 10:56 AM, Kai Gülzau <[email protected]>wrote:
>
>>
>> > Hmmm dude if i were you i would create a string representing the table
>> and
>> > set('html') of the table element.got it?
>>
>> suggested loop:
>>
>> var arr = [];
>> for (var i=0; i<loop; i++) {
>> arr.push('<tr>');
>> arr.push('<td>');
>> arr.push('<b>text</b>');
>> arr.push(i);
>> arr.push('</td>');
>> arr.push('</tr>');
>> }
>> $('tbody').set('html', arr.join(''));
>>
>> But "set('html', 'text')" for table, tbody, tr will end up in a
>> function in Element.Properties.html in IE
>> which internally appends all childNodes from a temporary wrapper
>> Element filled via innerHTML.
>>
>> > report the results please.
>> It's getting worse in IE7: 3000ms
>>
>> Demo page http://wfxde1.appspot.com/ is updated.
>
>
>