Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > JavaScript ECMAScript definitions

Reply
Thread Tools

JavaScript ECMAScript definitions

 
 
manno
Guest
Posts: n/a
 
      04-23-2004
Hi all,

more or less just out of curiosity...

I had a short 'discussion' about JavaScript in different borwsers. The
other guy said that there's differeces in JavaScript accross browsers (I
assumed he meant apart from versions) "because there's different
functions".
I didn't agree because I think that's because of different DOM's. I know
that for example IE 5.0 (or 5.5?) does not support array.push() (and a
lot more), but isn't that just sloppy implementation or simply using
different versions of the language?

Is it safe to say that one version of JavaScript should be the same
everywhere except for DOM differences?

Is JavaScript ECMA-262 with browserspecific elements?

Thanks in advance,

Manno
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      04-23-2004


manno wrote:


> I had a short 'discussion' about JavaScript in different borwsers. The
> other guy said that there's differeces in JavaScript accross browsers (I
> assumed he meant apart from versions) "because there's different
> functions".
> I didn't agree because I think that's because of different DOM's. I know
> that for example IE 5.0 (or 5.5?) does not support array.push() (and a
> lot more), but isn't that just sloppy implementation or simply using
> different versions of the language?


Well, array.push is not part of the DOM at all, its a method of the core
object Array.


> Is JavaScript ECMA-262 with browserspecific elements?


It depends on whom you ask and perhaps it also depends when you ask or
asked someone.
With its introduction in the Netscape 2.02 browser there was only one
implementation of the language and that was in a browser environment but
there was no ECMAScript standard at all. Later Netscape used its
JavaScript engine also on the server and documented both client-side
JavaScript and server-side JavaScript "versions" which consisted of core
objects specified in ECMAScript and host environment specific objects
like window, document in client-side JavaScript and server specific
objects in server-side JavaScript.
By now Netscape respectively Mozilla has two open-source JavaScript
engines, one called Spidermonkey implemented in C, the other called
Rhino imlemented in Java, and there are many different applications that
use those engines. So you can have JavaScript scripting in many
environments, not only browser specific ones.
And the MS JScript scripting engine can also be embedded in many
different environments, in the IE browser but as well in ASP pages as in
Windows Script host.

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
manno
Guest
Posts: n/a
 
      04-23-2004
Martin Honnen wrote:

> Well, array.push is not part of the DOM at all, its a method of the core
> object Array.


I know the array object's functions are no part of any DOM, I was trying
to go along in the arguments of the guy I argued with. But to go
_against_ his argument, is it sloppy implementation or just another
version of JavaScript that IE 5 version uses?

> So you can have JavaScript scripting in many
> environments, not only browser specific ones.


That was more or less why I asked, Flash (and the new Director MX 2004)
support "ECMAScript-compliant JavaScript syntax", I was wondering if
this actually could be said of browsers too: "Firefox supports
ECMAScript-compliant JavaScript syntax".

All with a different 'DOM' ofcourse.

Thanks
Manno
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      04-23-2004


manno wrote:

> Martin Honnen wrote:
>
>> Well, array.push is not part of the DOM at all, its a method of the
>> core object Array.

>
>
> I know the array object's functions are no part of any DOM, I was trying
> to go along in the arguments of the guy I argued with. But to go
> _against_ his argument, is it sloppy implementation or just another
> version of JavaScript that IE 5 version uses?


MS calls its implementation of JavaScript/ECMAScript JScript. I think
IE5 came with JScript 5 and whether at that time ECMAScript edition 3
was already out I don't remember exactly, I think Windows 98 already
featured IE5 while the ECMAScript edition 3 standard came out at the end
of 1999 thus MS was probably not sloppy in implementing that standard
but rather focussing on other things and waiting for ECMAScript edition
3 to be finalized.
--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      04-23-2004
manno <(E-Mail Removed)> writes:

> I know the array object's functions are no part of any DOM, I was
> trying to go along in the arguments of the guy I argued with. But to
> go _against_ his argument, is it sloppy implementation or just another
> version of JavaScript that IE 5 version uses?


It's JScript, not Javascript. There is no standard for Javascript
(except perhaps Netscape's documentation for JavaScript).
What there is, is ECMAScript, as specified by ECMA 262. It is currently
at version 3. Array.prototype.push was not in ECMA 262 v2, but is in
v3. It is likely that the versions of JScript shipped with IE 5 was
based on ECMA 262 v2.

> That was more or less why I asked, Flash (and the new Director MX
> 2004) support "ECMAScript-compliant JavaScript syntax", I was
> wondering if this actually could be said of browsers too: "Firefox
> supports ECMAScript-compliant JavaScript syntax".


Sure. And it is just a way of saying "supports ECMAScript" that still
makes sense for people who think it's all called Javascript.

/L
--
Lasse Reichstein Nielsen - http://www.velocityreviews.com/forums/(E-Mail Removed)
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
Java script Dude
Guest
Posts: n/a
 
      04-23-2004
manno <(E-Mail Removed)> wrote in message news:<40891a11$0$559$(E-Mail Removed)4all.nl>...
> Hi all,
>
> more or less just out of curiosity...
>
> I had a short 'discussion' about JavaScript in different borwsers. The
> other guy said that there's differeces in JavaScript accross browsers (I
> assumed he meant apart from versions) "because there's different
> functions".
> I didn't agree because I think that's because of different DOM's. I know
> that for example IE 5.0 (or 5.5?) does not support array.push() (and a
> lot more), but isn't that just sloppy implementation or simply using
> different versions of the language?
>
> Is it safe to say that one version of JavaScript should be the same
> everywhere except for DOM differences?
>
> Is JavaScript ECMA-262 with browserspecific elements?
>
> Thanks in advance,
>
> Manno


IE 5.5+ supports array.push(), IE Mac does not.
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      04-24-2004


Dr John Stockton wrote:

> JRS: In article <40892a9d$(E-Mail Removed)>, seen in
> news:comp.lang.javascript, Martin Honnen <(E-Mail Removed)> posted at
> Fri, 23 Apr 2004 16:39:21 :
>
>>MS calls its implementation of JavaScript/ECMAScript JScript. I think
>>IE5 came with JScript 5 and whether at that time ECMAScript edition 3
>>was already out I don't remember exactly, I think Windows 98 already
>>featured IE5 while the ECMAScript edition 3 standard came out at the end
>>of 1999 thus MS was probably not sloppy in implementing that standard
>>but rather focussing on other things and waiting for ECMAScript edition
>>3 to be finalized.

>
>
> Windows 98 was released in the UK (on 1998-07-01, IIRC) with MSIE 4
> 4.72.3110 SP1 using JScript 3.1.2124 or so it seems.


Somehow I still associate some IE5 release with some Windows 98 release,
I think there is also Windows 98 second edition (Windows 98 2 ED), maybe
that came with IE5 and was still out before the ECMAScript edition 3
specification.


--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-03-2004
manno wrote:
> About the JScript in IE. I was aware of JScript, but thought it was
> totally seperate from JavaScript [...]


It is. Nevertheless both JavaScript and JScript are ECMAScript
implementations (actually, JScript claims to be one while JavaScript is
one), so they share common objects and methods. However, since objects and
methods may be (and actually are) implemented differently. ECMAScript is a
language to be implemented and the language specification makes clear where
a conforming implementation has certain liberties.

> But if IE calls it JScript and doesn't run JavaScript, what happens with
> the type and language attribute of the script tag if set to
> "text/JavaScript" and "JavaScript{version}"?


It executes it anyway, using an engine that supports both JScript and VBScript.


PointedEars
 
Reply With Quote
 
Jim Ley
Guest
Posts: n/a
 
      05-03-2004
On Mon, 03 May 2004 05:35:07 +0200, Thomas 'PointedEars' Lahn
<(E-Mail Removed)> wrote:

>manno wrote:
>> About the JScript in IE. I was aware of JScript, but thought it was
>> totally seperate from JavaScript [...]

>
>It is. Nevertheless both JavaScript and JScript are ECMAScript
>implementations (actually, JScript claims to be one while JavaScript is
>one),


Sorry, why do you claim a distinction, the number of non-conformance
to the specs is minimal in both implementations, but both
implementations have them. JavaScript is certainly not a conformant
implementation any more than JScript is.

>It executes it anyway, using an engine that supports both JScript and VBScript.


The core Script Engine doesn't support both JScript and VBScript,
there's a host engine which supports any ActiveScripting language, and
there's seperate implementations of JScript and VBScript - delete
vbscript.dll from your windows box and JScript still works fine.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-03-2004
Jim Ley wrote:

> Thomas 'PointedEars' Lahn <(E-Mail Removed)> wrote:
>> manno wrote:
>>> About the JScript in IE. I was aware of JScript, but thought it was
>>> totally seperate from JavaScript [...]

>>
>> It is. Nevertheless both JavaScript and JScript are ECMAScript
>> implementations (actually, JScript claims to be one while JavaScript is
>> one),

>
> Sorry, why do you claim a distinction, the number of non-conformance to
> the specs is minimal in both implementations, but both implementations
> have them. JavaScript is certainly not a conformant implementation any
> more than JScript is.


Two obvious reasons: For example, I know of versions of JScript which yield
a script error even if one only tests *if* a property exists. In JScript,
only a function statement with mandatory identifier is specified; the
"function" operator (allowing for anonymous functions) as defined in
JavaScript, works anyway. I do not know of similar flaws in JavaScript.

>> It executes it anyway, using an engine that supports both JScript and
>> VBScript.

>
> The core Script Engine doesn't support both JScript and VBScript, there's
> a host engine which supports any ActiveScripting language, and there's
> seperate implementations of JScript and VBScript - delete vbscript.dll
> from your windows box and JScript still works fine.


ACK, thanks.


PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript / ECMAScript Martin Rinehart Javascript 5 11-14-2008 01:46 AM
EcmaScript, ECMAScript, or JavaScript ? dhtml Javascript 32 10-13-2008 01:55 PM
Python with Ecmascript jiri.zahradil@gmail.com Python 14 07-11-2008 06:35 PM
E4X "ECMAScript For XML" Patrick.O.Ige ASP .Net 0 01-23-2007 01:25 AM
Question about some basic functions in SVG ECMAScript RC XML 1 06-14-2006 03:38 PM



Advertisments