On 11/12/2009 12:56 PM, Jerome Velociter wrote:
Hello all,
I think it would be nice to have the possibility to post-load some of
the JavaScript extensions, as a way to ease performance best practices
for developers. (See
http://developer.yahoo.com/performance/rules.html#postload for example).
It would also allow people to easily add hungry third party scripts
(like the google analytics tracker) in a non intrusive manner and not
sacrificing performance (no need to modify/override htmlfooter.vm for
example, a simple SX always-use will do).
I see different ways of doing that :
1) Either we say all document JSX are post-loaded, and we move the hook
down the DOM just before the closing</body> tag.
2) Either we have 2 hooks and we leave it as an option to be post-loaded.
Wouldn't the defer attribute be much simpler? It does almost the same
thing, but using only HTML, and requires very little changes.
We can add a new property in the JSX class to differentiate defered and
non-defered extensions.
My preference goes to 1), as I don't see any good
use case where a
extension would need not to be post-loaded; and 2) is not so elegant to
implement with the current SX mecanism.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/