Antje Hofmann: gettype() in Javascript?? erkennen vom Variablentyp

Beitrag lesen

Hallo Christian

Ja, da taeuschst du dich, und zwar ganz gewaltig ;-)
JScript ist proprietaerer Microsoft-Schrott: unstandartisiert, was MS
gerade implementiert ist JScript. Natuerlich laeuft es nur im IE.

etwas sehr arrogant und überheblich die Aussage. Das im IE JScript verwendet wird, hat historische Gründe.

Mal ein kleiner Blick in die Dokus:

JScript:
What Is JScript?
JScript is the Microsoft implementation of the ECMA 262 language specification (ECMAScript Edition 3). With only a few minor exceptions (to maintain backwards compatibility), JScript is a full implementation of the ECMA standard.

Auch JavaScript ist im Grunde proprietaeres Zeug, wie du so schön behauptest. Denn das ist eine spezielle Netscapevariante.

JavaScript is Netscape's cross-platform, object-oriented scripting language. JavaScript is a small, lightweight language; it is not useful as a standalone language, but is designed for easy embedding in other products and applications, such as web browsers. Inside a host environment, JavaScript can be connected to the objects of its environment to provide programmatic control over them.

However, Netscape is working with ECMA (European Computer Manufacturers Association) to deliver a standardized, international programming language based on core JavaScript. ECMA is an international standards association for information and communication systems. This standardized version of JavaScript, called ECMAScript, behaves the same way in all applications that support the standard. Companies can use the open standard language to develop their implementation of JavaScript. The first version of the ECMA standard is documented in the ECMA-262 specification.

JScript aehnlich  zu JavaScript ist, ist Zufall.

Nein, das liegt darin, dass beide Sprachen auf den gleichen Standards aufsetzen. Würden wir korrekt sein, so müßte statt JavaScript immer die Bezeichnung ECMScript 262 verwendet werden. Nur spricht sich das so schlecht :-).

'document.all' ist

z. B. eine JScript-Erweiterung.

Falsch. Was zu JScript alles gehört kannst du unter http://msdn.microsoft.com/library/en-us/script56/html/js56jsoriversioninformation.asp nachlesen. Die All-Collection ist nicht Bestandteil von JScript, sondern gehört zum DOM des Internet Explorers und wurde eingeführt, als noch "all" diskutiert wurde.
Zu diesem Zeitpunkt gab es das DOM noch gar nicht. Ich habe recherchiert und das jüngste Dokument   beim W3C zum DOM Level 1 ist datiert vom 09.10.1997. Zum IE 4 fand ich eine Angabe vom Juni 1997.
Du kannst keinem Hersteller zum Vorwurf machen, dass er nicht in die Zukunft sehen kann. Du machst ja auch dem Netscape 4 nicht den Vorwurf den Layertag eingeführt zu haben.

Seit dem Internet Explorer 5 wird auch das DOM zunehmend besser unterstützt. Allerdings ist der IE abwärtskompatibel und schleppt deswegen die All-Collection mit sich rum.

Christian, etwas weniger Fanatismus und mehr Sachlichkeit im Bezug auf die Browserunterschiede würde allen gut tun. Wenn man schon über "proprietaerer Schrott" schimpft, dann bitte die Beschimpfungen gleich verteilen. Denn auch Mozilla kocht an manchen Stellen ein eigenes proprietaeres Süppchen.

Viele Grüße

Antje