As Google pagespeed (and many other tools) suggest.. we need to have the ability to load scripts on the footer, i don't see this is supported by joomla. A simple enhancement that bring BIG impact in pagesload (and SEO).
Just a note. To my knowledge Google doesn't recommend to load the script in the footer. Their advise is to load a small script which in turn will load all the scripts after the page is loaded.
Joomla already supports to load the script asynchronous or deferred. Both ways would help with pagespeed and are part of the HTML specification. But it needs to be declared by the extension developers in the code. Because not every script can be loaded with those options.
as @Bakual already noted, Google suggests to use defer
....
but we can't do it by default while we have inline JS code, and while other extension have inline JS code, also this is the reason why it will not work if we place the script at the footer.
so no chance for Joomla! 3 ... I think
but maybe it can be reviewed for Joomla! 4 ...
there we can declare that we will use defer
(or else) so extensions developer will be ready ... just theory
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 16:56:15 |
Closed_By | ⇒ | brianteeman |
Closed as we have combined several identical feature requests to #10250
+1 by me.
Maybe another flag on the addScript and addScriptDeclaration methods should be introduced.
Best.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8271.