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


Groups > comp.lang.javascript > #20445 > unrolled thread

How can javascript detect a fieldset in an array of elements

Started bybugbuster <barryk_56@comcast.net>
First post2013-06-25 19:22 -0400
Last post2013-06-27 21:27 +0100
Articles 20 on this page of 37 — 10 participants

Back to article view | Back to comp.lang.javascript


Contents

  How can javascript detect a fieldset in an array of elements bugbuster <barryk_56@comcast.net> - 2013-06-25 19:22 -0400
    Re: How can javascript detect a fieldset in an array of elements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-26 02:34 +0200
      Re: How can javascript detect a fieldset in an array of elements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-26 02:39 +0200
      Re: How can javascript detect a fieldset in an array of elements John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-26 16:10 +0100
        Re: How can javascript detect a fieldset in an array of elements Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-26 21:21 +0000
          Re: How can javascript detect a fieldset in an array of elements Andrew Poulos <ap_prog@hotmail.com> - 2013-06-27 08:12 +1000
            Re: How can javascript detect a fieldset in an array of elements Tim Streater <timstreater@greenbee.net> - 2013-06-26 23:21 +0100
              Re: How can javascript detect a fieldset in an array of elements Andrew Poulos <ap_prog@hotmail.com> - 2013-06-27 11:58 +1000
          Re: How can javascript detect a fieldset in an array of elements Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-27 00:14 +0200
            Re: How can javascript detect a fieldset in an array of elements Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 00:45 +0200
              “javascript”? (was: How can javascript detect a fieldset in an array of elements) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 13:36 +0200
                Re: “javascript”? Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-07-29 01:21 +0200
                  Re: “javascript”? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-07-30 08:51 +0200
              Re: How can javascript detect a fieldset in an array of elements Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-27 14:52 +0200
            Re: How can javascript detect a fieldset in an array of elements "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-27 14:04 +0300
              Re: How can javascript detect a fieldset in an array of elements Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-27 14:45 +0200
                Re: How can javascript detect a fieldset in an array of elements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 15:11 +0200
          Re: How can javascript detect a fieldset in an array of elements Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 00:45 +0200
            “javascript”? (was: How can javascript detect a fieldset in an array of elements) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 14:21 +0200
            Re: How can javascript detect a fieldset in an array of elements John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-27 14:31 +0100
              Parlance (was: How can javascript detect a fieldset in an array of elements) Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 16:21 +0200
                Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 20:46 +0200
                  Re: Parlance John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-28 14:33 +0100
                    Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 15:54 +0200
                      Re: Parlance "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-28 17:08 +0300
                        Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 17:05 +0200
                          Re: Parlance "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-28 18:16 +0300
                            Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 17:56 +0200
                              Re: Parlance Tim Streater <timstreater@greenbee.net> - 2013-06-28 17:54 +0100
                                Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 20:50 +0200
                                Re: Parlance Andrew Poulos <ap_prog@hotmail.com> - 2013-06-29 07:18 +1000
                      Re: Parlance John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-29 17:17 +0100
                Re: Parlance (was: How can javascript detect a fieldset in an array of elements) John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-28 14:53 +0100
                  Re: Parlance Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-15 00:42 +0200
                    Re: Parlance John Harris <niam@jghnorth.org.uk.invalid> - 2013-07-15 16:01 +0100
    Re: How can javascript detect a fieldset in an array of elements "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-26 08:55 +0300
    Re: How can javascript detect a fieldset in an array of elements Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-06-27 21:27 +0100

Page 1 of 2  [1] 2  Next page →


#20445 — How can javascript detect a fieldset in an array of elements

Frombugbuster <barryk_56@comcast.net>
Date2013-06-25 19:22 -0400
SubjectHow can javascript detect a fieldset in an array of elements
Message-ID<379ks8thdutnrglv34mc63mr95kgbglopo@4ax.com>
I have a javascipt function which I use to erase all the field in a
<FORM>. On those forms where yhere is a <fieldset> tag the script
encounters a problem.

my laptop is a win 7 laptop and I use the IE browser.

Here is my javascript function


function clearForm(oForm)
{
	var elements = oForm.elements;
	var count = elements.length;

//	oForm.reset();

	for ( i = 0 ; i < elements.length ; i++ )
	{

		field_type = elements[i].type.toLowerCase();
		switch(field_type)
		{
			case "text":
			case "password":
			case "textarea":
			case "hidden":	
				elements[i].value = "";
				break;

			case "radio":
			case "checkbox":
				if ( elements[i].checked ) {
					elements[i].checked = false;
				}
				break;

			case "select-one":
			case "select-multiple":
				elements[i].selectedIndex = -1;
				break;

			default:
				break;
		} // SWITCH
    } // FOR
}

When i use this function on a FORM that has a fieldset then the line

field_type = elements[i].type.toLowerCase();


errors out. IE reports that "type" is undefined/has no value.

How can I modify the function to overcome this issue ?


[toc] | [next] | [standalone]


#20447

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-06-26 02:34 +0200
Message-ID<2529079.e95EOKG17B@PointedEars.de>
In reply to#20445
bugbuster wrote:

> I have a javascipt function which I use to erase all the field in a
> <FORM>. On those forms where yhere is a <fieldset> tag the script
> encounters a problem.
> 
> my laptop is a win 7 laptop and I use the IE browser.

IE 9 or 10?
 
> Here is my javascript function

There is no javascript: <http://PointedEars.de/es-matrix>

> function clearForm(oForm)
> {
> var elements = oForm.elements;
> var count = elements.length;
> 
> //	oForm.reset();
> 
> for ( i = 0 ; i < elements.length ; i++ )

You should declare those identifiers variables, and avoid repeated property 
access.  It is safer, and a lot faster:

  for (var i = 0, len = elements.length; i < len; ++i)

> {
> 
> field_type = elements[i].type.toLowerCase();

    var field_type = elements[i].type.toLowerCase();

> switch(field_type)
> {
> case "text":
> case "password":
> case "textarea":
> case "hidden":
> elements[i].value = "";
> break;
> 
> case "radio":
> case "checkbox":
> if ( elements[i].checked ) {
> elements[i].checked = false;
> }
> break;
> 
> case "select-one":
> case "select-multiple":
> elements[i].selectedIndex = -1;
> break;
> 
> default:
> break;
> } // SWITCH
>     } // FOR
> }
> 
> When i use this function on a FORM that has a fieldset then the line
> 
> field_type = elements[i].type.toLowerCase();
> 
> 
> errors out. IE reports that "type" is undefined/has no value.
> 
> How can I modify the function to overcome this issue ?

The reason of the error is most likely not that there is a “fieldset” 
element, but that there are several controls that have the same name.  For 
example, it is common to put a radiobutton group into a “fieldset” element.  
All radiobuttons of a group must have the same name to be dependent on one 
another.

In that case,

  elements[i]

refers to a NodeList of references to those controls.  An object 
implementing the NodeList interface does not have a “type” property.
As the property does not exist, accessing it results in “undefined”,
and “undefined” has no properties.

You can use the fact above to your advantage to find out whether there is a 
group of same-named controls that need to be processed differently:

  var control = elements[i];
  if (typeof control.type == "undefined")
  {
    /* iterate over NodeList */
    for (var j = 0, len2 = control.length; j < len2; ++j)
    {
      // …
    }

    // …
  }


Please post using your real name next time.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#20448

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-06-26 02:39 +0200
Message-ID<1506321.WIFe3XHvss@PointedEars.de>
In reply to#20447
Thomas 'PointedEars' Lahn wrote:

> The reason of the error is most likely not that there is a “fieldset”
> element, but that there are several controls that have the same name.  For
> example, it is common to put a radiobutton group into a “fieldset”
> element. All radiobuttons of a group must have the same name to be
> dependent on one another.
> 
> In that case,
> 
>   elements[i]
> 
> refers to a NodeList of references to those controls.

But that probably does not apply here.  It applies when you access controls 
by name instead of by index.

> An object implementing the NodeList interface does not have a “type”
> property.  As the property does not exist, accessing it results in
> “undefined”, and “undefined” has no properties.
> 
> You can use the fact above to your advantage to find out whether there is
> a group of same-named controls that need to be processed differently:
> 
>   var control = elements[i];
>   if (typeof control.type == "undefined")
>   {

But the second part of the explanation should apply and this approach should 
work regardless.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#20452

FromJohn Harris <niam@jghnorth.org.uk.invalid>
Date2013-06-26 16:10 +0100
Message-ID<5u0ms85crfigrnrh2qprofhj9k3h8f41gd@4ax.com>
In reply to#20447
On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:


  <snip>
>There is no javascript: <http://PointedEars.de/es-matrix>
  <snip>

He wants you to write "ECMAScript + DOM2" instead because he thinks
the word "javascript" might confuse you.

  John

[toc] | [prev] | [next] | [standalone]


#20454

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-06-26 21:21 +0000
Message-ID<kqfm0f$jej$1@dont-email.me>
In reply to#20452
On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:

> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
> <PointedEars@web.de> wrote:

>   <snip>
>>There is no javascript: <http://PointedEars.de/es-matrix>
>   <snip>

> He wants you to write "ECMAScript + DOM2" instead because he thinks the
> word "javascript" might confuse you.

As long as the appropriate value for the type attribute of the html 
script tag is "text/javascript" he can engrave his "ecmascript + dom2" on 
a razorblade and stick it up his bum.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#20456

FromAndrew Poulos <ap_prog@hotmail.com>
Date2013-06-27 08:12 +1000
Message-ID<5c2dnXM00evU-lbMnZ2dnUVZ_tydnZ2d@westnet.com.au>
In reply to#20454
On 27/06/2013 7:21 AM, Denis McMahon wrote:
> On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:
>
>> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
>> <PointedEars@web.de> wrote:
>
>>    <snip>
>>> There is no javascript: <http://PointedEars.de/es-matrix>
>>    <snip>
>
>> He wants you to write "ECMAScript + DOM2" instead because he thinks the
>> word "javascript" might confuse you.
>
> As long as the appropriate value for the type attribute of the html
> script tag is "text/javascript" he can engrave his "ecmascript + dom2" on
> a razorblade and stick it up his bum.

So you had an irresistible urge to be offensive?

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#20458

FromTim Streater <timstreater@greenbee.net>
Date2013-06-26 23:21 +0100
Message-ID<timstreater-7EEAFA.23214026062013@news.individual.net>
In reply to#20456
In article <5c2dnXM00evU-lbMnZ2dnUVZ_tydnZ2d@westnet.com.au>,
 Andrew Poulos <ap_prog@hotmail.com> wrote:

> On 27/06/2013 7:21 AM, Denis McMahon wrote:
> > On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:
> >
> >> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
> >> <PointedEars@web.de> wrote:
> >
> >>    <snip>
> >>> There is no javascript: <http://PointedEars.de/es-matrix>
> >>    <snip>
> >
> >> He wants you to write "ECMAScript + DOM2" instead because he thinks the
> >> word "javascript" might confuse you.
> >
> > As long as the appropriate value for the type attribute of the html
> > script tag is "text/javascript" he can engrave his "ecmascript + dom2" on
> > a razorblade and stick it up his bum.
> 
> So you had an irresistible urge to be offensive?

We're all humbly following in the footsteps of the Great Master of 
Offensiveness, PointyHead.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#20464

FromAndrew Poulos <ap_prog@hotmail.com>
Date2013-06-27 11:58 +1000
Message-ID<6KadnUPKkJH3AVbMnZ2dnUVZ_jQAAAAA@westnet.com.au>
In reply to#20458
On 27/06/2013 8:21 AM, Tim Streater wrote:
> In article <5c2dnXM00evU-lbMnZ2dnUVZ_tydnZ2d@westnet.com.au>,
> Andrew Poulos <ap_prog@hotmail.com> wrote:
>
>> On 27/06/2013 7:21 AM, Denis McMahon wrote:
>> > On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:
>> >
>> >> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
>> >> <PointedEars@web.de> wrote:
>> >
>> >>    <snip>
>> >>> There is no javascript: <http://PointedEars.de/es-matrix>
>> >>    <snip>
>> >
>> >> He wants you to write "ECMAScript + DOM2" instead because he thinks
>> the
>> >> word "javascript" might confuse you.
>> >
>> > As long as the appropriate value for the type attribute of the html
>> > script tag is "text/javascript" he can engrave his "ecmascript +
>> dom2" on
>> > a razorblade and stick it up his bum.
>>
>> So you had an irresistible urge to be offensive?
>
> We're all humbly following in the footsteps of the Great Master of
> Offensiveness, PointyHead.

Take responsibility for your own actions.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#20457

FromEric Bednarz <bednarz@fahr-zur-hoelle.org>
Date2013-06-27 00:14 +0200
Message-ID<m2y59wa5ad.fsf@nntp.bednarz.nl>
In reply to#20454
Denis McMahon <denismfmcmahon@gmail.com> writes:

> As long as the appropriate value for the type attribute

The type attribute for the SCRIPT element type was introduced in HTML
4.0/4.01 (1998/1999).

> of the html 
> script tag

*ding* *ding* *ding*

> is "text/javascript"

"text/javascript" didn't mean anything before RFC 4329 (2006).
See the problem with the timeline here?
(From then on, it is "obsolete", not "appropriate".)

[toc] | [prev] | [next] | [standalone]


#20460

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2013-06-27 00:45 +0200
Message-ID<51cb6ed8$0$6572$9b4e6d93@newsspool3.arcor-online.net>
In reply to#20457
Eric Bednarz wrote:
> Denis McMahon <denismfmcmahon@gmail.com> writes:
> 
>> As long as the appropriate value for the type attribute
> 
> The type attribute for the SCRIPT element type was introduced in HTML
> 4.0/4.01 (1998/1999).
> 
>> of the html 
>> script tag
> 
> *ding* *ding* *ding*

ACK.

>> is "text/javascript"
> 
> "text/javascript" didn't mean anything before RFC 4329 (2006).
> See the problem with the timeline here?
> (From then on, it is "obsolete", not "appropriate".)

Unfortunately RFC 4329 is in "Category: Informational" only. :|

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#20466 — “javascript”? (was: How can javascript detect a fieldset in an array of elements)

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-06-27 13:36 +0200
Subject“javascript”? (was: How can javascript detect a fieldset in an array of elements)
Message-ID<3258609.Vzo5JXIDYN@PointedEars.de>
In reply to#20460
Christoph Michael Becker wrote:

> Eric Bednarz wrote:
>> Denis McMahon <denismfmcmahon@gmail.com> writes:
>>> As long as the appropriate value for the type attribute
>> 
>> The type attribute for the SCRIPT element type was introduced in HTML
>> 4.0/4.01 (1998/1999).
>> 
>>> of the html
>>> script tag
>> 
>> *ding* *ding* *ding*
> 
> ACK.

ACK :)

>>> is "text/javascript"

Ouch.

>> "text/javascript" didn't mean anything before RFC 4329 (2006).

Not entirely true:

<http://wayback.archive.org/web/20100904140711/http://pointedears.de/scripts/test/mime-types/>

[I need to update that based on the Matrix's test framework.]

>> See the problem with the timeline here?

Apropos: <http://PointedEars.de/es-matrix#timeline>
(you might want to read the Changelog on this)

[And no, I am _not_ advocating to say “ECMAScript + DOM2” *instead of* 
“javascript”.  To assume that conveys a fundamental misunderstanding of the 
Matrix's introductory sections.  I am advocating instead that you should use 
each of the *precise* terms (not only and not particularly those mentioned 
above) where they are *necessary* and *appropriate* (and only *those* 
*then*), to avoid misunderstandings and avoid creating misconceptions in 
beginners.  “javascript” as an umbrella term for *everything* scripted is 
_not_ precise; it is ambiguous and misleading, and should therefore be 
avoided.  For example, the Subject of this thread could have done well 
without any mention of “javascript”.]

>> (From then on, it is "obsolete", not "appropriate".)
> 
> Unfortunately RFC 4329 is in "Category: Informational" only. :|

I do not think it would change anything if it were on the Standards Track 
because browser vendors do not forego year-long backwards compatibility just 
because someone suggests it to the IETF.

See also: <http://stackoverflow.com/a/7227303/855543>.

Björn Höhrmann, author of that RFC, has pointed out to me in Usenet that 
there was no “deprecated” label available, so he had to choose “obsolete”. 

I still think it was a mistake to choose any label for it in the first 
place; it would have been better to suggest “*/javascript” for Mozilla 
JavaScript and recommend against it for code written for other 
implementations; perhaps */ecmascript or those that do not extend ECMAScript 
that much.  But the RFC's “Introduction” also makes it clear to me that this 
is yet another example of “the world's most misunderstood programming 
language”, and we witness but the result of that.

That said, in SVG you probably better use application/ecmascript.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#20828 — Re: “javascript”?

FromEric Bednarz <bednarz@fahr-zur-hoelle.org>
Date2013-07-29 01:21 +0200
SubjectRe: “javascript”?
Message-ID<m2hafenudp.fsf@nntp.bednarz.nl>
In reply to#20466
Thomas 'PointedEars' Lahn <PointedEars@web.de> writes:

> Apropos: <http://PointedEars.de/es-matrix#timeline>

I'm quite late here, sorry, but this is really very nice, thanks.

[toc] | [prev] | [next] | [standalone]


#20840 — Re: “javascript”?

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-07-30 08:51 +0200
SubjectRe: “javascript”?
Message-ID<9711902.QNo58lmr0S@PointedEars.de>
In reply to#20828
Eric Bednarz wrote:

> Thomas 'PointedEars' Lahn <PointedEars@web.de> writes:
>> Apropos: <http://PointedEars.de/es-matrix#timeline>
> 
> I'm quite late here, sorry, but this is really very nice, thanks.

You're welcome.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#20469

FromEric Bednarz <bednarz@fahr-zur-hoelle.org>
Date2013-06-27 14:52 +0200
Message-ID<m28v1vzpfk.fsf@nntp.bednarz.nl>
In reply to#20460
Christoph Michael Becker <cmbecker69@arcor.de> writes:

> Eric Bednarz wrote:

>> "text/javascript" didn't mean anything before RFC 4329 (2006).
>> See the problem with the timeline here?
>> (From then on, it is "obsolete", not "appropriate".)
>
> Unfortunately RFC 4329 is in "Category: Informational" only. :|

That doesn't mean it hasn't been relevant:

http://www.iana.org/assignments/media-types/application
http://www.iana.org/assignments/media-types/text

[toc] | [prev] | [next] | [standalone]


#20465

From"Jukka K. Korpela" <jkorpela@cs.tut.fi>
Date2013-06-27 14:04 +0300
Message-ID<kqh5t4$va$1@dont-email.me>
In reply to#20457
2013-06-27 1:14, Eric Bednarz wrote:

> Denis McMahon <denismfmcmahon@gmail.com> writes:
>
>> As long as the appropriate value for the type attribute
>
> The type attribute for the SCRIPT element type was introduced in HTML
> 4.0/4.01 (1998/1999).

Is this remark supposed to be relevant?

>> of the html
>> script tag
>
> *ding* *ding* *ding*

Dingeli dong. The attribute value is written in the start tag <script 
...>, so it would be pointless to argue against such parlance. Confusing 
tags with elements can be misleading and harmful, but not in a case like 
this.

>> is "text/javascript"
>
> "text/javascript" didn't mean anything before RFC 4329 (2006).
> See the problem with the timeline here?
> (From then on, it is "obsolete", not "appropriate".)

It has always (ever since <script> tag/element was implemented) been the 
media type that is universally recognized by browsers that support 
JavaScript. That is, it is the way that actually works. If 
specifications have problems with this, you might have a problem if your 
company or something else sitting above you forces you to comply with 
specifications. But the problem is then in the specifications and in the 
unsound requirements to comply with unrealistic specifications.

This is more or less water under the bridge now, since 
type="text/javascript" was never needed, and HTML5 makes this official.

Of course, this does not change the reality of the use of the name 
"JavaScript". Everyone calls a certain set of closely interrelated 
languages "JavaScript", except very few who fail to understand how 
computer languages are defined and used, or pretend to be ignorant of 
this. JavaScript is reality, somewhat vague as reality tends to be, and 
ECMAScript is a standard that aims at making JavaScript implementations 
more compatible.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

[toc] | [prev] | [next] | [standalone]


#20468

FromEric Bednarz <bednarz@fahr-zur-hoelle.org>
Date2013-06-27 14:45 +0200
Message-ID<m2fvw3zpq4.fsf@nntp.bednarz.nl>
In reply to#20465
"Jukka K. Korpela" <jkorpela@cs.tut.fi> writes:

> 2013-06-27 1:14, Eric Bednarz wrote:
>
>> Denis McMahon <denismfmcmahon@gmail.com> writes:
>>
>>> As long as the appropriate value for the type attribute
>>
>> The type attribute for the SCRIPT element type was introduced in HTML
>> 4.0/4.01 (1998/1999).
>
> Is this remark supposed to be relevant?

There wasn't an appropriate script content type value at the time the
recommendation was written, and for years to come. Was HTML 4 supposed
to be relevant, be it in the context of Denis' statement or be it in
general (the answer is always 'no', of course, but I've learned that it
is better to formulate that as a rethorical question, like you did)?

>>> of the html
>>> script tag
>>
>> *ding* *ding* *ding*
>
> Dingeli dong. The attribute value is written in the start tag

OK, *now* I'm gonna nitpick: the attribute value *literal* is written in
the start tag.

[toc] | [prev] | [next] | [standalone]


#20470

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-06-27 15:11 +0200
Message-ID<1717787.uR0EY2PbsK@PointedEars.de>
In reply to#20468
Eric Bednarz wrote:

> "Jukka K. Korpela" <jkorpela@cs.tut.fi> writes:
>> 2013-06-27 1:14, Eric Bednarz wrote:
>>> Denis McMahon <denismfmcmahon@gmail.com> writes:
>>>> of the html
>>>> script tag
>>>
>>> *ding* *ding* *ding*
>>
>> Dingeli dong. The attribute value is written in the start tag
> 
> OK, *now* I'm gonna nitpick: the attribute value *literal* is written in
> the start tag.

Not “start-tag“ anymore?

SCNR

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#20459

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2013-06-27 00:45 +0200
Message-ID<51cb6ebc$0$6572$9b4e6d93@newsspool3.arcor-online.net>
In reply to#20454
Denis McMahon wrote:
> On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:
> 
>> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
>> <PointedEars@web.de> wrote:
> 
>>   <snip>
>>> There is no javascript: <http://PointedEars.de/es-matrix>
>>   <snip>
> 
>> He wants you to write "ECMAScript + DOM2" instead because he thinks the
>> word "javascript" might confuse you.

In fact, the abbreviation is confusing -- at least for beginners.  When
I was new to the topic (what's not too long ago), I was not aware that
the language and the browser API are not directly related.  Looking up
normative information on the internet was nearly impossible to
accomplish for me in these days.  Fortunately "he" (and Mark David) made
me aware of this "detail".  Otherwise I might still wander around in the
dark...

BTW: if I am not mistaken, Thomas again made the point that there is *no
single language* called "javascript", but instead there are several
distinct ECMAScript *implementations*.  And of course, there is not just
DOM level 2.

> As long as the appropriate value for the type attribute of the html 
> script tag is "text/javascript" he can engrave his "ecmascript + dom2" on 
> a razorblade and stick it up his bum.

Methinks thou dost protest too much.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#20467 — “javascript”? (was: How can javascript detect a fieldset in an array of elements)

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-06-27 14:21 +0200
Subject“javascript”? (was: How can javascript detect a fieldset in an array of elements)
Message-ID<1421418.lZt1yVURcq@PointedEars.de>
In reply to#20459
Christoph Michael Becker wrote:

> Denis McMahon wrote:
>> On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:
>>> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
>>> <PointedEars@web.de> wrote:
>>>   <snip>
>>>> There is no javascript: <http://PointedEars.de/es-matrix>
>>>   <snip>
>>> 
>>> He wants you to write "ECMAScript + DOM2" instead because he thinks the
>>> word "javascript" might confuse you.
> 
> In fact, the abbreviation is confusing -- at least for beginners.  When
> I was new to the topic (what's not too long ago), I was not aware that
> the language and the browser API are not directly related.

[“javascript” is _not_ an abbreviation.  There is not even a definition for 
that term that people can universally agree on.  It is a misnomer instead.]

To be precise, they have not been directly related in JavaScript™ “only” 
since version 1.4 (Netscape Enterprise Server, after Netscape 4.x, before 
Mozilla.org and Netscape Navigator 6.0; 1999/2000 CE).

The assumption is that they have never been directly related for Microsoft 
JScript because firstly, the MSHTML browser component was not used not only 
in Internet Explorer from the beginning; secondly, JScript is used in WSH 
client-side and on IIS server-side as well; and thirdly, the *same* DOM API 
is available from other programming languages.  There are a jscript.dll 
*and* an mshtml.dll in …\system32, after all.

Finally, there is significant proof that they have never been directly 
related for the ECMAScript implementations that followed those two.  For 
example, we can observe Apple JavaScriptCore in Safari, and V8 JavaScript in 
Chromium/Chrome and in the Android browser component, but all of them use 
WebKit WebCore and *its* DOM (Chromium/Chrome used to, but will now switch 
to the Blink fork of WebCore, which should be interesting).  Also in recent 
news, Opera is about to switch from their Presto layout engine (and DOM) to 
WebKit (WebCore); they did not say anything about switching their ECMAScript 
implementation, currently Carakan (CMIIW), as well (and there is good no 
reason that they should).

> Looking up normative information on the internet was nearly impossible to
> accomplish for me in these days.  Fortunately "he" (and Mark David) made
> me aware of this "detail".  Otherwise I might still wander around in the
> dark...

I am glad that I could contribute my share to help.
 
> BTW: if I am not mistaken, Thomas again made the point that there is *no
> single language* called "javascript", but instead there are several
> distinct ECMAScript *implementations*.  And of course, there is not just
> DOM level 2.

You are not mistaken.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#20471

FromJohn Harris <niam@jghnorth.org.uk.invalid>
Date2013-06-27 14:31 +0100
Message-ID<4kfos8l7kvl1utrnl3jss23og31rsggamu@4ax.com>
In reply to#20459
On Thu, 27 Jun 2013 00:45:01 +0200, Christoph Michael Becker
<cmbecker69@arcor.de> wrote:

>Denis McMahon wrote:
>> On Wed, 26 Jun 2013 16:10:40 +0100, John Harris wrote:
>> 
>>> On Wed, 26 Jun 2013 02:34:30 +0200, Thomas 'PointedEars' Lahn
>>> <PointedEars@web.de> wrote:
>> 
>>>   <snip>
>>>> There is no javascript: <http://PointedEars.de/es-matrix>
>>>   <snip>
>> 
>>> He wants you to write "ECMAScript + DOM2" instead because he thinks the
>>> word "javascript" might confuse you.
>
>In fact, the abbreviation is confusing -- at least for beginners.  When
>I was new to the topic (what's not too long ago), I was not aware that
>the language and the browser API are not directly related.  Looking up
>normative information on the internet was nearly impossible to
>accomplish for me in these days.  Fortunately "he" (and Mark David) made
>me aware of this "detail".  Otherwise I might still wander around in the
>dark...
>
>BTW: if I am not mistaken, Thomas again made the point that there is *no
>single language* called "javascript", but instead there are several
>distinct ECMAScript *implementations*.  And of course, there is not just
>DOM level 2.
  <snip>

When you were in your state of not knowing, which would have helped
you more :

  Beware : "javascript" is a general name for a multitude of
  variants and implementations.

or

  There is no javascript.

The first is my preferred style of teaching. The second is Thomas's
parody of a music hall Herr Professor.


As for confusion, both "property" and "prototype" are far more
confusing than "javascript". Even after so many years there are still
people saying ECMAScript is a prototypal language (which is something
different).

  John

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web