

A better way to defer JS - sanj
http://www.feedthebot.com/pagespeed/defer-loading-javascript.html

======
greenyoda
Can't you replace the "addEventListener" stuff with <body
onload="downloadJSAtOnload()">?

~~~
tovmeod
what happens if you have more than one js? of course you should only have one,
but I may have a js file from my server and load jquery from google cdn.

in the example you can just appens the same code for each file

------
stephenr
as far as I'm concerned this is just another example of Google abusing it's
power in the search market.

if they really cared about "best results first" they would consider the time
till content is loaded for the visitor, not total time till the page loads.

~~~
nekgrim
Usually, content isn't loaded with JS. So defering JS makes sense, if you want
to show the content as quickly as possible.

~~~
stephenr
Right, and using the JS after body method achieves that, but google don't
measure time to content, they measure time to complete load.

------
ctietze
Nicely illustrated and concise!

