4 ms·
The bandwidth saved once gzipped cannot possibly outweigh the downside of another HTTP connection for the JS file and then the processing time needed to run it.
by JoelSutherland 14y ago
The bandwidth saved once gzipped cannot possibly outweigh the downside of another HTTP connection for the JS file and then the processing time needed to run it. Additionally a JS file at the top of your page will be blocking.
The benefit to the JS method is developer convenience.