#11834 closed enhancement (wontfix)
Move JavaScript before the end closing `body` tag
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | web frontend | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
There is no reason to block rendering of the page.
https://developer.yahoo.com/performance/rules.html#js_bottom
Attachments (0)
Change History (8)
comment:1 by , 10 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
follow-up: 7 comment:2 by , 10 years ago
We might try the async
attribute for all but the jquery script? (cf. SO:24070373)
comment:3 by , 10 years ago
Gotta love the reply of jomae.
Seriously, Trac is the slowest piece of crap around, yet you, core developers, keep ignoring key points. And this is only the frontend matter. Imagine digging further what will show.
Whatever, I guess it's time Trac died already.
comment:4 by , 10 years ago
Gotta love these anonymous "contributors" ;-)
If you're dissatisfied with Trac and its performance (or lack thereof), feel free to move on, we certainly won't try to hold you back (and no point in replying either, you've earned a free "delete comment" pass for your subsequent changes).
follow-up: 6 comment:5 by , 10 years ago
Since there is no way to register its hard to not be anon :)
Also, jQuery.ready()
is not the same thing at all, but since you use it, there shouldn't be a problem moving down the jquery, which *will* help with blocking rendering.
comment:6 by , 10 years ago
Replying to not-the-same-anonymous-person:
Since there is no way to register its hard to not be anon :)
Giving the benefit of doubt, although I have my doubts ;-) The same way you changed anonymous to not-the-same-anonymous-person you could have given your actual name (and there's the Preferences link you missed).
Also,
jQuery.ready()
is not the same thing at all, but since you use it, there shouldn't be a problem moving down the jquery, which *will* help with blocking rendering.
Please read the reference I've given above in comment:2, which discusses this matter. TL;DR placing the scripts at the end of body is an obsolete optimization which has its own downsides.
follow-up: 8 comment:7 by , 10 years ago
Replying to cboos:
We might try the
async
attribute for all but the jquery script? (cf. SO:24070373)
Interested. However, XHTML1 strict DTD disallows async
attribute in script element. Instead, it allows defer
attribute in script element.
Most of plugins and Trac core expect that depended scripts, e.g. jquery.js, trac.js, etc…, are already loaded. Then, the attribute can be used for only scripts with no dependencies. I think it's difficult to use effectively.
comment:8 by , 10 years ago
Replying to jomae:
Replying to cboos:
We might try the
async
attribute for all but the jquery script? (cf. SO:24070373)Interested. However, XHTML1 strict DTD disallows
async
attribute in script element.
I've been wondering, and posed the question before, how much longer should we aim to conform to XHTML1 strict? Eventually we should move to HTML5, right? The long-awaited Genshi 0.6.2/0.7.1 adds support for some HTML5 elements that I could see use utilizing: genshi:#577, genshi:#570. See also open ticket genshi:#518 and genshi:#578.
Maybe consider moving to HTML5 for Trac release 1.2? As far as I know we'd just need to change the DOCTYPE
declaration in templates, but I need to study the issue more.
No.
jQuery.ready()
is enough and that changes would break compatibilities in Trac.