Suggestion: <link rel="script">

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 UTC