Content deleted Content added
m r2.6.4) (Robot: Adding mr:जावास्क्रिप्ट |
Jerryobject (talk | contribs) m Template updated. Links: updated, WPDisambiguated; cut needless: pipes, underscores. Decapitalized: nonproper noun MOS:CAPS, nonacronym WP:ALLCAPS. Trademark MOS:TM tag cut. WP:SLASHes replaced. WP:ABBReviations defined. More. |
||
Line 9:
| developer= [[Netscape Communications Corporation]], [[Mozilla Foundation]]
| latest_release_version = 1.8.2<ref>[https://developer.mozilla.org/en/firefox_3.6_for_developers#JavaScript Firefox 3.6 supports JavaScript 1.8.2]</ref>
| latest_release_date = {{
| latest_preview_version = 1.8.5<ref>
{{cite web
Line 18:
|accessdate=August 10, 2010
}}</ref>
| latest_preview_date = {{
| typing = [[dynamic typing|dynamic]], [[weak typing|weak]], [[duck typing|duck]]
| implementations = [[
| influenced_by = [[C (programming language)|C]], [[Java (programming language)|Java]], [[Perl]], [[Python (programming language)|Python]], [[Scheme (programming language)|Scheme]], [[Self (programming language)|Self]]
| influenced = [[ActionScript]], [[CoffeeScript]], [[Dart (programming language)|Dart]], [[JScript .NET]], [[Objective-J]], [[QML]], TIScript
| license =
Line 67:
== 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 [[
JavaScript was originally developed by [[Brendan Eich]] of Netscape under the name ''Mocha'', which was later renamed to ''LiveScript'', and finally to JavaScript mainly because it was more influenced by the [[Java programming language]].<ref>{{cite web|last=Krill |first=Paul |url=http://www.infoworld.com/article/08/06/23/eich-javascript-interview_1.html |title=JavaScript creator ponders past, future |publisher=InfoWorld |date=2008-06-23 |accessdate=2009-05-19}}</ref><ref name="computerworld">{{cite web|last=Hamilton|first=Naomi|url=http://www.computerworld.com.au/article/255293/-z_programming_languages_javascript|title=The A-Z of Programming Languages: JavaScript|publisher=computerworld.com.au|date=2008-06-31}}</ref>
LiveScript was the official name for the language when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript in a joint announcement with Sun Microsystems on December 4, 1995,<ref>[http://web.archive.org/web/20070916144913/http://wp.netscape.com/newsref/pr/newsrelease67.html Press release announcing JavaScript], "Netscape and Sun announce Javascript
The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its [[Netscape Navigator]] web browser. The final choice of name caused confusion, giving the impression that the language was a spin-off of the [[Java programming language]], and the choice has been characterized by many as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web
It has also been claimed{{citation}} that the language's name is the result of a co-marketing deal between [[Netscape]] and [[Sun Microsystems|Sun]], in exchange for Netscape bundling Sun's Java runtime with its [[
JavaScript very quickly gained widespread success as a client-side scripting language for web pages. As a consequence, [[Microsoft]] named its implementation [[JScript]] to avoid trademark issues. JScript added new date methods to fix the [[Year 2000 problem|Y2K]]-problematic methods in JavaScript, which were based on Java's <code>[http://java.sun.com/j2se/1.4.2/docs/api/java/util/Date.html java.util.Date]</code> class.<ref name="popularity">{{cite web|url=http://brendaneich.com/2008/04/popularity/ |title=Popularity |author=Brendan Eich |date=3 April 2008 |accessdate=2012-01-19}}</ref> JScript was included in [[Internet Explorer]] 3.0, released in August 1996.
Line 117:
* conditional <code>catch</code> clauses
* iterator protocol adopted from [[Python (programming language)|Python]]
* shallow [[
* [[List comprehension|array comprehensions]] and generator expressions also adopted from Python
* proper block scope via the <code>let</code> keyword
Line 127:
{{Main|JavaScript syntax}}
{{As of|2011}}, the latest version of the language is JavaScript 1.8.5. It is a superset of [[ECMAScript]] (ECMA-262) Edition 3. Extensions to the language, including partial [[
=== Simple examples ===
Line 265:
* Transmitting information about the user's reading habits and browsing activities to various websites.{{Which?|date=December 2011}} Web pages frequently do this for [[web analytics]], [[ad tracking]], [[personalization]] or other purposes.{{Citation needed|date=December 2011}}
Because JavaScript code can run locally in a user's browser (rather than on a remote server), the browser can respond to user actions quickly, making an application more responsive. Furthermore, JavaScript code can detect user actions which HTML alone cannot, such as individual keystrokes. Applications such as [[Gmail]] take advantage of this: much of the user-interface logic is written in JavaScript, and JavaScript dispatches requests for information (such as the content of an e-mail message) to the server. The wider trend of [[
A [[JavaScript engine]] (also known as ''JavaScript interpreter'' or ''JavaScript implementation'') is an [[interpreter (computing)|interpreter]] that interprets JavaScript [[source code]] and executes the [[computer program|script]] accordingly. The first JavaScript engine was created by [[Brendan Eich]] at [[Netscape Communications Corporation]], for the [[Netscape Navigator]] [[web browser]]. The engine, code-named [[SpiderMonkey (JavaScript engine)|SpiderMonkey]], is implemented in [[C (programming language)|C]]. It has since been updated (in JavaScript 1.5) to conform to ECMA-262 Edition 3. The [[Rhino (JavaScript engine)|Rhino]] engine, created primarily by Norris Boyd (formerly of Netscape; now at Google) is a JavaScript implementation in [[Java (programming language)|Java]]. Rhino, like SpiderMonkey, is ECMA-262 Edition 3 compliant.
A web browser is by far the most common host environment for JavaScript. Web browsers typically use the public [[application programming interface|API]] to create "host objects" responsible for reflecting the [[Document Object Model
Because JavaScript is the only language that the most popular browsers share support for, it has become a [[target language (computing)|target language]] for many frameworks in other languages, even though JavaScript was never intended to be such a language.<ref name="computerworld" /> Despite the performance limitations inherent to its dynamic nature, the increasing speed of JavaScript engines has made the language a surprisingly feasible compilation target.
Line 282:
<head><title>simple page</title></head>
<body>
<h1 id="header">This is
<script type="text/javascript">
document.write('Hello World!');
Line 300:
Because JavaScript runs in widely varying environments, an important part of testing and debugging is to test and verify that the JavaScript works across multiple browsers.
The
To deal with these differences, JavaScript authors can attempt to write standards-compliant code which will also be executed correctly by most browsers; failing that, they can write code that checks for the presence of certain browser features and behaves differently if they are not available.<ref>Peter-Paul Koch, [http://www.quirksmode.org/js/support.html Object detection]</ref> In some cases, two browsers may both implement a feature but with different behavior, and authors may find it practical to detect what browser is running and change their script's behavior to match.<ref>Peter-Paul Koch, [http://www.evolt.org/node/23335 Mission Impossible - mouse position]</ref><ref>Peter-Paul Koch, [http://www.quirksmode.org/js/detect.html Browser detect]</ref> Programmers may also use libraries or toolkits which take browser differences into account.
Line 411:
=== Application platform ===
* [[ActionScript]], the programming language used in [[Adobe Flash]], is another implementation of the ECMAScript standard.
* The [[Mozilla]] platform, which underlies [[
* [[Adobe Integrated Runtime]] is a JavaScript runtime that allows developers to create desktop applications.
* [http://www.mynfc.org/ myNFC.org] is a JavaScript based framework that allows developers to create applications for smart phones.
Line 457:
| 1.2 || June 1997 || || 4.0-4.05 || || || || ||
|-
| 1.3 || October 1998 || ECMA-262 1st
|-
| 1.4 || || || Netscape<br />Server || || || || ||
Line 463:
| 1.5 || November 2000 || ECMA-262 3rd edition || 6.0 || 1.0 || 5.5 (JScript 5.5),<br />6 (JScript 5.6),<br />7 (JScript 5.7),<br />8 (JScript 5.8) || 6.0 || 3.0-5 || 1.0-10.0.666
|-
| 1.6 || November 2005 || 1.5 +
|-
| 1.7 || October 2006 || 1.6 + Pythonic generators +
|-
| 1.8 || June 2008 || 1.7 + [[
|-
| 1.8.1 || || 1.8 + [[JSON#
|-
| 1.8.2 || June 22, 2009 || 1.8.1 +
|-
| 1.8.5 || July 27, 2010 || 1.8.2 + [[ECMAScript]] 5
|}
Line 482:
[[jQuery]] and [[Prototype JavaScript Framework|Prototype]] are popular JavaScript libraries designed to simplify [[DOM]]-oriented client-side HTML scripting.
Mozilla browsers currently support [[LiveConnect]], a feature that allows JavaScript and Java to intercommunicate on the web. However, Mozilla-specific support for LiveConnect is scheduled to be phased out in the future in favor of passing on the LiveConnect handling via [[NPAPI]] to the Java 1.6+ plug-in (not yet supported on the Mac {{as of|March 2010|lc=
=== Use as an intermediate language ===
Line 506:
== See also ==
{{Portal|Computer programming}}
* [[Ajax (programming)
* [[Comparison of JavaScript-based source code editors]]
* [[Comparison of JavaScript frameworks]]
* [[Document Object Model
* [[Dynamic HTML]]
* [[ECMAScript]]
* [[JavaScript engine]]
* [[JSON|JavaScript Object Notation (JSON)]]
* [[JavaScript syntax]]
* [[Unobtrusive JavaScript]]
* [[Dart (programming language)|Dart]]
* [[Progressive enhancement]]
{{Clear}}
Line 554:
** [https://developer.mozilla.org/en/A_re-introduction_to_JavaScript Re-Introduction to JavaScript]
* [http://eloquentjavascript.net/ Eloquent JavaScript]
* [http://dev.opera.com/articles/javascript/ JavaScript
* [http://www.html5libs.com/ JavaScript Libraries Comparison Matrix Tool]
Line 560:
{{ECMAScript}}
{{DEFAULTSORT:
[[Category:Cross-platform software]]
[[Category:JavaScript| ]]
|