[3.4.8] Include external CSS before external JavaScript

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
User avatar
layer8
Joomla! Intern
Joomla! Intern
Posts: 68
Joined: Mon Dec 05, 2011 4:37 am

[3.4.8] Include external CSS before external JavaScript

Post by layer8 » Sun Dec 27, 2015 3:11 am

[3.4.8] Include external CSS before external JavaScript

How to reproduce the error?
Go to:
joomla backend -> Extensions -> Templates -> protostar -> Advanced -> Google Font for Headings -> Set value to YES

Then go to:
gtmetrix.com and analyze your site’s speed

Results
You will get this error under the tab "Optimize the order of styles and scripts":

The following external CSS files were included after an external JavaScript file in example.com. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.
fonts.googleapis.com/css?family=Open+Sans

User avatar
xfsgpr
Joomla! Ace
Joomla! Ace
Posts: 1020
Joined: Mon Feb 14, 2011 4:02 am
Location: London

Re: [3.4.8] Include external CSS before external JavaScript

Post by xfsgpr » Sun Dec 27, 2015 8:05 pm

Personally, I prefer all scripts to be loaded AFTER the page is loaded. This means that all js files should be loaded by inserting the code just before the closing body element.

Code: Select all

<body>
.......
.......
.......

(your script goes here>
</body>
People should be allowed to view the page before any functions on the page IMO.


Locked

Return to “Joomla! 3.x Bug Reporting”