Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('table').remove();
- $('</table>').appendTo('body');
- startDate = new Date().getTime();$.each(arr, function(count, item) {
- var newTd = $('<td></td>').html(item).attr('name','pieTD');
- var newTr = $('<tr></tr>');
- newTr.append(newTd);
- $('table').append(newTr);
- });
- endDate = new Date().getTime();
- console.log(endDate - startDate);
- $('table').remove();
- $('</table>').appendTo('body');
- startDate = new Date().getTime();
- var textToInsert = ''; var i = 0; var length = arr.length;
- for (var a = 0; a <length; a += 1) {
- textToInsert += '<tr><td name="pieTD">';
- textToInsert += arr[a];
- textToInsert += '</td> </tr>' ;
- }
- $('table').append(textToInsert);
- endDate = new Date().getTime();
- console.log(endDate - startDate);
- $('table').remove();
- $('</table>').appendTo('body');
- startDate = new Date().getTime();
- var textToInsert = []; var i = 0; var length = arr.length;
- for (var a = 0; a <length; a += 1) {
- textToInsert[i++] = '<tr><td name="pieTD">';
- textToInsert[i++] = arr[a];
- textToInsert[i++] = '</td> </tr>' ;
- }
- $('table').append(textToInsert.join(''));
- endDate = new Date().getTime();
- console.log(endDate - startDate);
Add Comment
Please, Sign In to add comment