[html5] r2105 - [a] (0) Reword the <script> section to allow the element to be used for data blo [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Aug 22 12:57:51 PDT 2008


Author: ianh
Date: 2008-08-22 12:57:49 -0700 (Fri, 22 Aug 2008)
New Revision: 2105

Modified:
   index
   source
Log:
[a] (0) Reword the <script> section to allow the element to be used for data blocks that aren't actually used by any scripts. Also include an example.

Modified: index
===================================================================
--- index	2008-08-22 07:12:59 UTC (rev 2104)
+++ index	2008-08-22 19:57:49 UTC (rev 2105)
@@ -26442,7 +26442,7 @@
   </dl>
 
   <p>The <code><a href="#script1">script</a></code> element allows authors to
-   include dynamic script and script data in their documents.
+   include dynamic script and data blocks in their documents.
 
   <p>When used to include dynamic scripts, the scripts may either be embedded
    inline or may be imported from an external file using the <code
@@ -26453,18 +26453,18 @@
    href="#type11">type</a></code> attribute is present, its value must be the
    type of the script's language.
 
-  <p>When used to include script data, the script data must be embedded
-   inline, the format of the data must be given using the <code
-   title=attr-script-type><a href="#type11">type</a></code> attribute, and
-   the <code title=attr-script-src><a href="#src9">src</a></code> attribute
-   must not be specified.
+  <p>When used to include data blocks, the data must be embedded inline, the
+   format of the data must be given using the <code title=attr-script-type><a
+   href="#type11">type</a></code> attribute, and the <code
+   title=attr-script-src><a href="#src9">src</a></code> attribute must not be
+   specified.
 
   <p>The <dfn id=type11 title=attr-script-type><code>type</code></dfn>
-   attribute gives the language of the script or format of the script data.
-   If the attribute is present, its value must be a valid MIME type,
-   optionally with parameters. The <code title="">charset</code> parameter
-   must not be specified. (The default, which is used if the attribute is
-   absent, is "<code title="">text/javascript</code>".) <a
+   attribute gives the language of the script or format of the data. If the
+   attribute is present, its value must be a valid MIME type, optionally with
+   parameters. The <code title="">charset</code> parameter must not be
+   specified. (The default, which is used if the attribute is absent, is
+   "<code title="">text/javascript</code>".) <a
    href="#refsRFC2046">[RFC2046]</a>
 
   <p>The <dfn id=src9 title=attr-script-src><code>src</code></dfn> attribute,
@@ -26884,6 +26884,26 @@
    way as the <code><a href="#textcontent">textContent</a></code> DOM
    attribute.
 
+  <div class=example>
+   <p>In this example, two <code><a href="#script1">script</a></code>
+    elements are used. One embeds an external script, and the other includes
+    some data.</p>
+
+   <pre><script src="game-engine.js"></script>
+<script type="text/x-game-map">
+........U.........e
+o............x....e
+.....x.....xxx....e
+.x..xxx...xxxxx...e
+</script></pre>
+
+   <p>The data in this case might be used by the script to generate the map
+    of a video game. The data doesn't have to be used that way, though; maybe
+    the map data is actually embedded in other parts of the page's markup,
+    and the data block here is just used by the site's search engine to help
+    users who are looking for particular features in their game maps.</p>
+  </div>
+
   <h5 id=scriptingLanguages><span class=secno>4.10.1.1. </span>Scripting
    languages</h5>
 

Modified: source
===================================================================
--- source	2008-08-22 07:12:59 UTC (rev 2104)
+++ source	2008-08-22 19:57:49 UTC (rev 2105)
@@ -23807,7 +23807,7 @@
   </dl>
 
   <p>The <code>script</code> element allows authors to include dynamic
-  script and script data in their documents.</p>
+  script and data blocks in their documents.</p>
 
   <p>When used to include dynamic scripts, the scripts may either be
   embedded inline or may be imported from an external file using the
@@ -23818,16 +23818,16 @@
   attribute is present, its value must be the type of the script's
   language.</p>
 
-  <p>When used to include script data, the script data must be
-  embedded inline, the format of the data must be given using the
-  <code title="attr-script-type">type</code> attribute, and the <code
+  <p>When used to include data blocks, the data must be embedded
+  inline, the format of the data must be given using the <code
+  title="attr-script-type">type</code> attribute, and the <code
   title="attr-script-src">src</code> attribute must not be
   specified.</p>
 
   <p>The <dfn title="attr-script-type"><code>type</code></dfn>
-  attribute gives the language of the script or format of the script
-  data. If the attribute is present, its value must be a valid MIME
-  type, optionally with parameters. The <code title="">charset</code>
+  attribute gives the language of the script or format of the data. If
+  the attribute is present, its value must be a valid MIME type,
+  optionally with parameters. The <code title="">charset</code>
   parameter must not be specified. (The default, which is used if the
   attribute is absent, is "<code title="">text/javascript</code>".) <a
   href="#refsRFC2046">[RFC2046]</a></p>
@@ -24340,6 +24340,30 @@
   same way as the <code>textContent</code> DOM attribute.</p>
 
 
+  <div class="example">
+
+   <p>In this example, two <code>script</code> elements are used. One
+   embeds an external script, and the other includes some data.</p>
+
+   <pre><script src="game-engine.js"></script>
+<script type="text/x-game-map">
+........U.........e
+o............x....e
+.....x.....xxx....e
+.x..xxx...xxxxx...e
+</script></pre>
+
+   <p>The data in this case might be used by the script to generate
+   the map of a video game. The data doesn't have to be used that way,
+   though; maybe the map data is actually embedded in other parts of
+   the page's markup, and the data block here is just used by the
+   site's search engine to help users who are looking for particular
+   features in their game maps.</p>
+
+  </div>
+
+
+
   <h5 id="scriptingLanguages">Scripting languages</h5>
 
   <p>A user agent is said to <dfn>support the scripting language</dfn>




More information about the Commit-Watchers mailing list