Optimize performance / Load CSS and JS in parallel on firefox

Move the inline <script> after the external <script> because the internal JS between CSS <link> and external JS makes firefox loading CSS and JS not in parallel.
The internal js is now parsed last but will still be executed first since everything else is deferred js.

Signed-off-by: Michael Letzgus <michaelletzgus@users.noreply.github.com>
This commit is contained in:
Michael Letzgus 2017-06-24 11:35:40 +02:00
parent 4526b8d6a3
commit c77fe1ab86
1 changed files with 3 additions and 3 deletions

View File

@ -96,12 +96,12 @@ function emit_script_tag($src, $script_content='') {
* @param hash $obj all the script information from template
*/
function emit_script_loading_tags($obj) {
if (!empty($obj['inline_ocjs'])) {
emit_script_tag('', $obj['inline_ocjs']);
}
foreach($obj['jsfiles'] as $jsfile) {
emit_script_tag($jsfile, '');
}
if (!empty($obj['inline_ocjs'])) {
emit_script_tag('', $obj['inline_ocjs']);
}
}
/**