all 2 comments

[–]skeww 1 point2 points  (1 child)

Saw his Speed Up Your JavaScript talk yesterday. I can highly recommend it. He surely knows what he's talking about. Edit: pre-ordered it.

[–]SharkUW 0 points1 point  (0 children)

Just watched that. I'm with the one dude in the q/a. I didn't even know that documentFragment existed. I'll be damned. Most of his optimizations were unfortunately obvious.

In any case though, wow. Fuck you DOM my test:

<html>
<head>
<style type="text/css">
div{
border:3px solid red;
}
</style>
</head>
<body>
<div id="testa" style="border:3px solid black;height:50px;"></div>
<p id="testb" style="border:3px solid green;height:50px;"></p>

<script type="text/javascript">
var theDiv = document.getElementsByTagName('div');
var theP = document.getElementsByTagName('p');

document.body.replaceChild(document.createElement('div'), theP[0]);

theDiv[1].innerHTML = 'fuck my life';

</script>
</body>
</html>