HTML5 suggestion: Elements of HTML section: Scripting and Document Metadata subsections

When using JavaScript libraries such as jQuery or MooTools, they currently need to be called from another file using an empty <script></script> element. It is not currently possible, however, for a browser to have such libraries pre-installed.

I would like to suggest the introduction of an empty <library> (<library /> in XHTML) containing the attributes:
name (required) - the library's name. Case insensitive.
minvers - the minimum version required
maxvers - the maximum version required
src - the URL of the library, if a suitable version isn't pre-installed, similar to <script>
type - just like <script>, the MIME type of the library. Defaults to "text/javascript".

For example, jQuery (at least 1.4) could be called using:
<library name="jquery" minvers="1.4" src="jquery-1.6.2.min.js" />

Thanks,
Andrew Martin

Received on Saturday, 23 July 2011 15:05:43 UTC