About JavaScript

by 2 contributors:

Diese Übersetzung ist unvollständig. Bitte helfen Sie, diesen Artikel aus dem Englischen zu übersetzen.

What is JavaScript?

JavaScript® is the Netscape-developed object scripting language used in millions of web pages and server applications worldwide. Netscape's JavaScript is a superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language, with only mild differences from the published standard.

Contrary to popular misconception, JavaScript is not "Interpretive Java". In a nutshell, JavaScript is a dynamic scripting language supporting prototype based object construction. The basic syntax is intentionally similar to both Java and C++ to reduce the number of new concepts required to learn the language. Language constructs, such as if statements, for and while loops, and switch and try ... catch blocks function the same as in these languages (or nearly so.)

JavaScript can function as both a procedural and an object oriented language. Objects are created programmatically in JavaScript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class definitions common in compiled languages like C++ and Java. Once an object has been constructed it can be used as a blueprint (or prototype) for creating similar objects.

JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for ... in), and source code recovery (JavaScript programs can decompile function bodies back into their source text).

Intrinsic objects are Number, String, Boolean, Date, RegExp, and Math.

For a more in depth discussion of JavaScript programming follow the JavaScript resources links below.

Was für JavaScript-Implementierungen stehen zur Verfügung?

mozilla.org hostet zwei JavaScript-Implementierungen. Das überhaupt erste JavaScript hat Brendan Eich bei Netscape entwickelt und seitdem wurde es immer wieder aktualisiert bis zur Übereinstimmung mit der ECMA 262 (Ausgabe 5) Spezifikation und späteren Versionen. Diese Engine, Codename SpiderMonkey, ist in C implementiert. Die Rhino Engine, hauptsächlich von Norris Boyd entwickelt (auch bei Netscape), ist eine JavaScript Implementierung in Java. Wie SpiderMonkey ist Rhino mit ECMA-262 (Ausgabe 3) konform.

Immer wieder wurden etliche Optimierungen wie TraceMonkey (Firefox 3.5), JägerMonkey (Firefox 4) und IonMonkey zur SpiderMonkey JavaScript Engine hinzugefügt.

Neben den oben genannten Implementierungen gibt es auch noch andere populäre Implementierungen, insbesondere:

  • Google's V8, die im Google-Browser Chrome und neueren Versionen des Opera-Browsers verwendet wird.
  • Die Implementierung JavaScriptCore (SquirrelFish/Nitro), die von manchen Webkit-Browsern wie z.B. Safari von Apple benutzt wird.
  • Carakan in alten Versionen von Opera.
  • Die Chakra Engine im Internet Explorer (auch wenn die Sprache die sie implementiert offiziell "JScript" genannt wird um Auseinandersetzungen mit Markenrechten zu vermeiden).

Jede mozilla.org JavaScript Engine stellt eine öffentliche API zur Verfügung, die Anwendungen für JavaScript-Support nutzen können. Webbrowser sind mit großem Abstand die typische Ablaufumgebung schlechthin für JavaScript. Webbrowser benutzen üblicherweise die öffentliche API um "Host-Objekte" zu erzeugen, die dafür zuständig sind, den DOM in JavaScript abzubilden.

Eine andere häufige Anwendungsart für JavaScript ist die der (web-) server-seitigen Scriptsprache. Ein JavaScript-Webserver stellt hier Host-Objekte zur Verfügung, die HTTP-Anfragen- und Antwort-Objekte darstellen, auf die dann wiederum von einem JavaScript-Programm zugegriffen werden kann um dynamisch Webseiten zu erzeugen.

JavaScript Ressourcen

SpiderMonkey
Information specific to JavaScript in C engine (aka SpiderMonkey) embedding.
Rhino
Information specific to the JavaScript implementation written in Java (aka Rhino).
Language resources
Pointers to published JavaScript standards.
A re-introduction to JavaScript
JavaScript guide and JavaScript reference.

Schlagwörter des Dokuments und Mitwirkende

 Mitwirkende an dieser Seite: judy55, loki
 Zuletzt aktualisiert von: judy55,
Seitenleiste ausblenden