JavaScript: Difference between revisions

Content deleted Content added
m Cleaned up using AutoEd
Reverted 1 edit by Rsrikanth05 (talk): Rv - trashed embedded HTML markup. (TW)
Line 53:
{{JavaScriptSidebar}}
 
'''JavaScript''' (sometimes abbreviated '''JS''') is a [[prototype-based]] [[scripting language]] that is [[dynamic language|dynamic]], [[weak typing|weakly typed]], [[General-purpose programming language |general purpose programming language]] and has [[first-class functions]]. It is a [[multi-paradigm]] language, supporting [[Object-oriented programming|object-oriented]],<ref name="ECMA-262">{{cite web|url=http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf | title= ECMAScript Language Specification }}</ref> [[imperative programming|imperative]], and [[functional programming|functional]]<ref name="jsfunc">{{cite video |people= [[Douglas Crockford]] |date= |title= Douglas Crockford on Functional JavaScript |url= http://www.blinkx.com/video/douglas-crockford-on-functional-javascript/xscZz8XhfuNQ_aaVuyUB2A |format= flv |medium= Tech talk |publisher=[[blinkx]] |time= 2:49 |quote=[JavaScript] is also coincidentally the world's most popular functional programming language. JavaScript is and has always been, at least since [version] 1.2, a functional programming language.}}</ref><ref>[http://www.crockford.com/javascript/little.html The Little JavaScripter] shows the relationship with Scheme in more detail.</ref> programming styles.
 
JavaScript was formalized in the [[ECMAScript]] language standard and is primarily used in the form of [[client-side JavaScript]], implemented as part of a [[Web browser]] in order to provide enhanced [[user interface]]s and dynamic [[website]]s. This enables [[Computer programming|programmatic]] access to computational objects within a host environment.
Line 62:
 
==History==
{{quote box|width = 200px|Anyway I know only one [[programming language]] worse than [[C (programming language)|C]] and that is Javascript. [...] I was convinced that we needed to build-in a programming language, but the developers, [[Tim Berners-Lee|Tim]] first, were very much opposed. It had to remain completely declarative. Maybe, but the net result is that the programming-vacuum filled itself with the most horrible [[kludge|kluge]] in the history of computing: Javascript.|[[Robert Cailliau]]<ref>[[nwikinews:Wikinews:Story preparation/Interview with Robert Cailliau]]</ref>}}
 
===Birth at Netscape===
Line 298:
<head><title>simple page</title></head>
<body>
<h1 id="header">This is JavaScript=</h1>
<script type="text/javascript">
document.write('Hello World!');
var h1 = document.getElementById("header"); // holds a reference to the <h1> tag
h1 = document.getElementsByTagName("h1")[0]; // accessing the same <h1> element
<h1> tag
h1 = document.getElementsByTagName("h1")[0]; // accessing the same
<h1> element
</script>
<noscript>
Line 402 ⟶ 400:
* [[OpenOffice.org]] office application suite allows for JavaScript as one of its scripting languages.
* The interactive music signal processing software [[Max/MSP]] released by Cycling '74, offers a JavaScript model of its environment for use by developers. It allows much more precise control than the default GUI-centric programming model.
* ECMAScript was included in the [[VRML|VRML97]]97 standard for scripting nodes of VRML scene description files.
* Some high-end Philips [[universal remote]] panels, including TSU9600 and TSU9400, can be scripted using a JavaScript-based tool called ProntoScript.<ref>{{cite web|url=http://www.pronto.philips.com/prontoscript/index.cfm?id=1422 |title=Koninklijke Philips Electronics NV}}</ref>
* [[Sphere (program)|Sphere]] is an open source and cross platform computer program designed primarily to make role-playing games that use JavaScript as a scripting language.
Line 429 ⟶ 427:
* [http://www.jsdb.org/ JSDB] (JavaScript for Databases) is an open-source JavaScript shell for Windows, Mac OS X, Linux, and Unix, which extends the [[SpiderMonkey|Mozilla JavaScript engine]] with file, database, email, and network objects.
* [http://code.google.com/p/jslibs/ jslibs] is an open-source JavaScript shell for Windows and Linux which extends the [[SpiderMonkey|Mozilla JavaScript engine]]. It has the ability to call functions in commonly used libraries like NSPR, SQLite, libTomCrypt, OpenGL, OpenAL, and librsvg.
* Late Night Software's [[JavaScript OSA]] (aka JavaScript for OSA, or JSOSA) is a freeware alternative to [[AppleScript]] for Mac OS X. It is based on the Mozilla 1.5 JavaScript implementation, with the addition of a <code>MacOS</code> object for interaction with the operating system and third-party applications.<ref>[[AppleScript#Open Scripting ArchitectureOpen_Scripting_Architecture|Open Scripting Architecture]]</ref>
 
===Application platform===
Line 519 ⟶ 517:
* [http://code.google.com/p/phype/ Phype], an open source [[PHP]] to JavaScript compiler.
* [http://code.google.com/p/tiscript/ TIScript], a superset of JavaScript that adds classes, namespaces, and lambda expressions.
* [https://github.com/clojure/clojurescript ClojureScript], a [[Clojure]] to JavaScript compiler which is compatible with the advanced compilation mode of the [[Google Closure ToolsGoogle_Closure_Tools|Google Closure]] optimizing compiler.
* [http://common-lisp.net/project/parenscript Parenscript], a [[Common Lisp]] library that can translate into JavaScript both well-circumscribed [[Common Lisp]] code, and JavaScript rendered as "inlined" [[S-expression]]s in [[Common Lisp]] source code.
* [https://github.com/qsnake/py2js Py2JS], a subset of [[Python]]