Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #26816

Re: Definition of a script in JavaScript

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Definition of a script in JavaScript
Date 2015-02-07 16:31 +0100
Organization PointedEars Software (PES)
Message-ID <1843703.7QeMqOPspv@PointedEars.de> (permalink)
References <JavaScript-20150204202621@ram.dialup.fu-berlin.de> <b290acf4-c7be-49a8-9396-f0225386078d@googlegroups.com>

Show all headers | View raw


Charles Cossé wrote:

> Hi Stefan

This is Usenet, not a chat.

> On Wednesday, February 4, 2015 at 12:36:20 PM UTC-7, Stefan Ram wrote:
>>   I am trying to find this grammar rule. So far, I only found
>>   this in the MDN:
>> 
>>       »The HTML <script> element is used to embed or reference an
>>       executable script within an HTML or XHTML document.«
>>       ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
>>   But were is the definition of »executable script«?
>>   Where is the grammar rule for »executable script«?
> 
> The "definition" you refer to just means "valid javascript" (as opposed to
> html).

No, it does not.  And there is no “javascript”; certainly there is no such 
thing as “valid javascript” because ECMAScript implementations differ from 
one another.  At most, there are conforming ECMAScript implementations such 
that they agree in the core features as specified.  See my sig.

> If the valid js is in a file.js then it doesn't require script
> tags.

It MUST NOT contain SGML-based markup tags except in literals.  (Formerly, 
this included XML literals in *Mozilla* JavaScript, as part of its 
“ECMAScript for XML” [E4X] support.  Unfortunately, this support has been 
discontinued. [1])

> If it's embedded in a file.html then it does.

“Embed” is not the proper term here.  “Contained” is.

> If it's to be located in the <head> of a file.html

That would be a _“head” element_.

> then you also need to wrap the js section in <script> tags.

No, that would mean to wrap it in

  <script>

  <script>

But you need to "wrap" it in

  <script …>

  </script>

Elements are _not_ tags. [2][3]

[E4X] <http://www.ecma-international.org/publications/standards/Ecma-357.htm>
[1] <https://developer.mozilla.org/de/docs/E4X>
[2] <http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html#h-3.2.1>
[3] <http://www.w3.org/TR/2014/REC-html5-20141028/dom.html#elements>
-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Definition of a script in JavaScript Charles Cossé <ccosse@gmail.com> - 2015-02-04 11:47 -0800
  Re: Definition of a script in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-07 16:31 +0100
    Re: Definition of a script in JavaScript Scott Sauyet <scott.sauyet@gmail.com> - 2015-02-07 18:41 -0800
      Re: Definition of a script in JavaScript Tim Streater <timstreater@greenbee.net> - 2015-02-08 10:13 +0000
        Re: Definition of a script in JavaScript Scott Sauyet <scott.sauyet@gmail.com> - 2015-02-09 14:32 -0800
          Re: Definition of a script in JavaScript Tim Streater <timstreater@greenbee.net> - 2015-02-09 22:44 +0000
      Re: Definition of a script in JavaScript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-10 00:34 +0100
        Re: Definition of a script in JavaScript Scott Sauyet <scott.sauyet@gmail.com> - 2015-02-10 14:01 -0800
          Re: Definition of a script in JavaScript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-18 01:30 +0100
            Re: Definition of a script in JavaScript Scott Sauyet <scott.sauyet@gmail.com> - 2015-02-18 13:11 -0800
              Re: Definition of a script in JavaScript "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-02-20 11:35 -0800
                Re: Definition of a script in JavaScript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-21 01:56 +0100
                Re: Definition of a script in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-21 16:53 +0100
              Re: Definition of a script in JavaScript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-21 01:41 +0100
        Re: Definition of a script in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-21 17:37 +0100

csiph-web