W3C home > Mailing lists > Public > www-html@w3.org > August 2001

Suggestion: <link rel="script">

From: Clover Andrew <aclover@1value.com>
Date: Wed, 22 Aug 2001 11:32:30 +0200
Message-ID: <D58B0195B58937489E89124469E57CA20D5095@EX1.1value.com>
To: <www-html@w3.org>
While we're all holding our breath waiting for Cyril, Esq. to
complete his latest Symbolic Names masterpiece, here's another
quick idea.

Problem:
  <script> is undesirably overloaded. It is used to include
  embedded scripts in a document as well as to link to external
  scripts.

  Before XHTML, the latter usage also requires an unnecessary
  end-tag, with disastrous effects when forgotten by beginners.

  DOM Level 2 Events allow authors to set event bindings in
  their own scripts (addEventListener) rather than in the
  document (onsomeevent=""). This is desirable for encapsulation
  and use of multiple component scripts on the same page. But
  the script still needs to be called somehow, either by using
  <body onload> or by putting the script at the bottom of the
  page.

Solution:
  a new <link> type for scripts which could be used in the
  <head> in the same way as <link rel="stylesheet">. The script
  would executed when the page has been fully received.

Advantages:
  Links to stylesheets and scripts would be consistent. script
  links could also take advantage of media descriptors.

  <script src> could be deprecated, leaving <script> analogous
  to <style>.

  Purity - an HTML file with styling and scripting could finally
  be written with no inline or embedded content in other
  languages. Content-Script-Type could be avoided.

Disadvantages:
  Automated file scanners which tried to remove active content
  but were unaware of <link rel="script"> would be compromised.

Comments?

-- 
Andrew Clover
Technical Consultant
1VALUE.com AG
Received on Wednesday, 22 August 2001 05:35:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:49 GMT