W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2013

[whatwg] Deferred Javascript parsing

From: Benjamin Stürmer <benjamin.stuermer@gmail.com>
Date: Mon, 29 Apr 2013 22:21:10 +0200
Message-ID: <CADxW5acke7adpb+onyw=661MrkFsghq8tPMb9q92TudCxB+2ng@mail.gmail.com>
To: whatwg@lists.whatwg.org
I have been reading about a technique described here (
http://googlecode.blogspot.de/2009/09/gmail-for-mobile-html5-series-reducing.html)
for deferring the parsing of scripts until they are actually required. This
can be a useful technique for allowing lazy-loading of script without AJAX.
A common method used to achieve this (the method described in the linked
article) is commenting-out blocks of code and then uncommenting it and
running it via eval(), which is obviously not an ideal solution.

Has there been any consideration given to an attribute to mark a script tag
as "do not parse or execute" until it's been triggered? I've heard of this
technique often enough that it's clear there's an audience for a feature of
this nature.

~Benjamin
Received on Monday, 29 April 2013 20:21:36 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:57 UTC