ERasche has asked for the wisdom of the Perl Monks concerning the following question:
Recommend best practice suggests that javascript be passed as the very last part of a HTTP response, so it can load last of all. This is usually done to increase page load speeds, as javascript can download in the background while content is being rendered.
Is there any easy way to accomplish this with CGI.pm? As it stands, all of the javascript files are sent in the head element, which should result in slower page loads. This is fine in some cases where there's javascript to be executed in the page that requires the libraries to be loaded, but in many other cases (mine included), it would be perfectly fine to have it load last. Do the monks know of any options or settings which would allow this? If it's not a built in feature that's fine, I would just rather use the builtins if they're available. My internet searches turned up nothing on this topic. Cheers!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing javascript last in CGI
by ww (Archbishop) on Jul 25, 2012 at 21:20 UTC | |
by Anonymous Monk on Jul 26, 2012 at 05:43 UTC | |
|
Re: Passing javascript last in CGI
by tobyink (Canon) on Jul 25, 2012 at 20:08 UTC |