User tests: Successful: Unsuccessful:
The
<jdoc:include type="head" />
will still render the complete head. But using this:
<head>
<jdoc:include type="meta" />
<jdoc:include type="styles" />
you can echo the scripts at the bottom of the page
eg.:
<jdoc:include type="scripts" />
</body>
Description | <p>The will still render the complete head. But using this:<br></p><br><br><br> .<br> .<br> .<br> you can echo the scripts at the bottom of the page<br> eg.:<br><br><p><a href="https://groups.google.com/forum/#!topic/joomla-dev-cms/qlyWQEUj63g">https://groups.google.com/forum/#!topic/joomla-dev-cms/qlyWQEUj63g</a></p> | ⇒ | <p>The </p> <pre><code><jdoc:include type="head" /> </code></pre> <p>will still render the complete head. But using this:</p> <pre><code><head> <jdoc:include type="meta" /> <jdoc:include type="styles" /> </code></pre> <p>you can echo the scripts at the bottom of the page<br> eg.:</p> <pre><code><jdoc:include type="scripts" /> </body> </code></pre> |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2013-12-16 23:52:14 |
Labels |
Added:
?
|
Status | Closed | ⇒ | New |
One a sidenote: You can use for example this plugin to achieve the same: http://extensions.joomla.org/extensions/core-enhancements/performance/scripts-optimization/12559 and see their warning:
Many extensions insert javascript into the body and head. This isn't a set-and-forget plugin. It will require tuning. Some sites cannot function without javascripts in the head, and these sites may as well not run ScriptsDown.
Agree with bakual, the Joomla way of adding scripts is in the head.
@Bakual, @laoneo
Right now this is useless, but with the addition of methods like addScriptToHead() and addScriptToFooter() and probably doc:include type="headscripts" and doc:include type="bottomscripts" we might end up with a more modular and useful code.
there is a discussion about all these here:
https://groups.google.com/forum/#!topic/joomla-dev-cms/qlyWQEUj63g
Status | New | ⇒ | Closed |
Closed_Date | 2013-12-16 23:52:14 | ⇒ | 2013-12-19 12:19:28 |
Labels |
Added:
?
|
Aye, if new methods (or arguments) are added to load a script into footer, then this will work.
Closing this PR for now. You can always reopen it or create a new one if you have a testable solution.
Thanks!
This will likely break Javascript in 3rd party extensions and even in core. There are scripts which need to be loaded in the head to work properly. There are also cases where we have inline scripts depending on a script being loaded previously.
The proper way is to make use of the
$defer
and$async
flags in JDocument->addScript() (https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/document/document.php#L466).