Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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 Jun Omae, 10 years ago

Resolution: wontfix
Status: newclosed

No. jQuery.ready() is enough and that changes would break compatibilities in Trac.

comment:2 by Christian Boos, 10 years ago

We might try the async attribute for all but the jquery script? (cf. SO:24070373)

comment:3 by anonymous, 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 Christian Boos, 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).

comment:5 by not-the-same-anonymous-person, 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.

in reply to:  5 comment:6 by Christian Boos, 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.

in reply to:  2 ; comment:7 by Jun Omae, 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.

Last edited 10 years ago by Jun Omae (previous) (diff)

in reply to:  7 comment:8 by Ryan J Ollos, 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.