Re: <link> vs. <script> for external scripts

Hi All,

>Well since the attribute that specifies the scripting language of the
>script should be required, then if that attribute isn't there, it wouldn't
>be valid XHTML2, so it wouldn't be rendered, end of story.
>
(I'll use @language for these examples for simplicity, even though it 
may not be the actual name of the attribute)

Agreed, make @language a required attribute, and use the <script> 
element for internal scripts.  External scripts (without an internal 
substitute) should be included using a <link> element
    <link rel="Script" type="text/javascript" href="script"/>

  External scripts with an internal substitute would still be allowed 
using the following.
    <script language="text/javascript" type="text/vbscript" src="script">
        // Alternate Script
        <noscript>no script content</noscript>
    </script>

  With only @type, that is not possible, since @type would apply to both 
internal and external scripts.

>>>It has some other advantages besides allowing generic embedding.
>>>Since type is not a required attribute in general, but needs to be
>>>for script (and for style as well) so using a separate attribute seems
>>>preferable, especially if type allows for multiple types to be indicated.
>>>      
>>>
  Everthing above about <script> also applies to <style> because @type 
also applies to the internal content, rather than just an external 
resource.  It would be good if both <script> and <style> were given the 
same attribute for describing their internal content, and leave external 
scripts and styles, mostly, for the <link/> element.  Style would then 
become:
<style language="text/css">
/* stylesheet */
</style>

><script> added to <head>, MCM: (PCDATA|script)* ,
>
><blockscript> added to Block content, MCM: (PCDATA|blockscript|blocknoscript)* ,
><blocknoscript> added to Block content, MCM: (PCDATA | Flow)* ,
>
><inlinescript> added to Inline content, MCM: (PCDATA|inlinescript|inlinenoscript)*
><inlinenoscript> added to Inline content, MCM: (PCDATA|Inline)* .
>
I'd keep <noscript>, so that the script/noscript elements come in pairs:
* <script>/<noscript>, <blockscript>/<blocknoscript> and 
<inlinescript>/<inlinenoscript>

  This would certainly solve many of the problems, however, with the use 
of the DOM and XMLEvents, and the fact that document.write(), or 
similar, shouldn't be used any more, is there any need to have scripts 
outside of the head element and within the body?

CYA
...Lachy

Received on Thursday, 20 November 2003 02:32:36 UTC