JavaScript: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Caesar Schinas
(JavaScript is a Sun trademark)
mNo edit summary
 
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{subpages}}
{{subpages}}
'''JavaScript''' is a general-purpose computer [[scripting language]] which is frequently embedded in [[web page]]s on to make them interactive.
{{Infobox Programming Language
| name    = JavaScript
| creator  = Brendan Eich
| typing  = weak, dynamic
}}
'''JavaScript''' is a general-purpose computer [[programming language]] defined by a series of standards by [[ECMA International]] (ECMA) and known as ''ECMAScript''.  JavaScript runs in a web browser to help make [[web page]]s interactive.  Despite standardization, web browsers from different companies (or even different versions of a browser from the same company) may not handle JavaScript identically.  The uneven treatment of JavaScript by different web browsers is the single greatest challenge in JavaScript programming.  It is one reasons why so many programmers use a toolkit (Javascript library) such as [[jQuery]] instead, and it then becomes the responsibility of the library authors to handle the browser differences correctly in JavaScript.


JavaScript is not related to the [[Java]] programming language, despite the similar name. JavaScript was originally called LiveScript, but was re-branded due to a deal between [[Netscape and Sun Microsystems]], whereby Netscape used the name JavaScript, a Sun trademark,<ref>[http://www.sun.com/suntrademarks/ Sun Trademarks]</ref> in return for bundling Sun's Java runtime with the popular [[Netscape Browser]]<ref>http://web.archive.org/web/20080213171613/wp.netscape.com/newsref/pr/newsrelease67.html</ref>. JavaScript was intended as a complement to Java and so was designed to look similar.
JavaScript is not related to the [[Java]] programming language, despite the similar name. JavaScript was originally called LiveScript, but was re-branded due to a deal between [[Netscape]] and [[Sun Microsystems]], whereby Netscape used the name JavaScript, a Sun trademark,<ref>[http://www.sun.com/suntrademarks/ Sun Trademarks]</ref> in return for bundling Sun's Java runtime with the popular [[Netscape Browser]]<ref>http://web.archive.org/web/20080213171613/wp.netscape.com/newsref/pr/newsrelease67.html</ref>. JavaScript was intended as a complement to Java and so was designed to look similar.


When JavaScript code is embedded in [[HTML]] pages, [[web browser]]s will execute the JavaScript upon loading the web page.  The JavaScript within HTML may also execute in response to user actions on the page. Since in some cases JavaScript may be disabled in the web browser's options, well-designed HTML pages must be functional even if the JavaScript within them is not allowed to execute.   
When JavaScript code is embedded in [[HTML]] pages, [[web browser]]s will execute the JavaScript upon loading the web page, and some Javascript may execute when the user interacts with elements in the web page.  The JavaScript within HTML may also execute in response to user actions on the page. Since in some cases JavaScript may be disabled in the web browser's options, well-designed HTML pages must be functional even if the JavaScript within them is not allowed to execute.   


JavaScript has seen several versions since it initial introduction with Netscape Navigator 2.0 in 1995 and the latest version now include new features making it a more robust scripting language.  JavaScript script received an added boost when the browser started to expose more of the document object model (DOM) and allowed dynamic changes to the DOM.  This gave birth to was to be called Dynamic HTML or DHTML.  Not only were HTML elements be exposed to JavaScript programmers, but so were the events allowing JavaScript coded functions to handle those events.  No longer were web pages static and it provided a better user interaction with web surfers.  Allowing the HTML document to manipulated after the page was served and/or based on user interactions made wave for the next big web technology which made JavaScript indispensable.  
JavaScript has seen several versions since its initial introduction with Netscape Navigator 2.0 in 1995 and the latest version now include new features making it a more robust scripting language.  JavaScript script received an added boost when the browser started to expose more of the document object model (DOM) and allowed dynamic changes to the DOM; HTML elements became available to JavaScript programmers, as were the events allowing JavaScript coded functions to handle those events.  This provided a better user experience for web surfers.  Allowing the HTML document to manipulated after the page was served and/or based on user interactions made JavaScript important for the world wide web.  


The use of JavaScript to communicate in the background with a web server, and then to update small parts of an HTML page asynchronously without the delay or flashing associated with postback (in which the web server sends the browser a completely new HTML page) is broadly called [[AJAX (web technology)|Ajax]].  In fact, using JavaScript in this manner is so complex that many programmers do not work with JavaScript directly but instead, use one of many ''Ajax toolkits'' which group JavaScript into higher functions.  
The use of JavaScript to communicate in the background with a web server, and then to update small parts of an HTML page asynchronously without the delay or flashing associated with postback (in which the web server sends the browser a completely new HTML page) is broadly called [[AJAX (web technology)|Ajax]].  In fact, using JavaScript in this manner is so complex that many programmers do not work with JavaScript directly but instead, use one of many ''Ajax toolkits'' which group JavaScript into higher functions.  


JavaScript has been standardized by the [[European Computer Manufacturer's Association]] (ECMA) and is, these days, occasionally referred to as ECMA-script. Despite standardization, web browsers from different companies (or even different versions of a browser from the same company) may not handle JavaScript identically. The uneven treatment of JavaScript by different web browsers is the single greatest challenge in JavaScript programming.  It is one reasons why so many programmers use a toolkit instead, and it then becomes the responsibility of the toolkit authors to handle the browser differences correctly in JavaScript.
JavaScript supports all the structured programming syntax of C (e.g., if statements, while loops, switch statements, etc.). JavaScript is almost object-based. JavaScript relies on a run-time environment.


 
==References==
[[Category:CZ Live]]
{{reflist}}
[[Category:Computers Workgroup]]

Latest revision as of 10:01, 20 August 2023

This article is a stub and thus not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.
JavaScript
Created by Brendan Eich
Typing discipline weak, dynamic

JavaScript is a general-purpose computer programming language defined by a series of standards by ECMA International (ECMA) and known as ECMAScript. JavaScript runs in a web browser to help make web pages interactive. Despite standardization, web browsers from different companies (or even different versions of a browser from the same company) may not handle JavaScript identically. The uneven treatment of JavaScript by different web browsers is the single greatest challenge in JavaScript programming. It is one reasons why so many programmers use a toolkit (Javascript library) such as jQuery instead, and it then becomes the responsibility of the library authors to handle the browser differences correctly in JavaScript.

JavaScript is not related to the Java programming language, despite the similar name. JavaScript was originally called LiveScript, but was re-branded due to a deal between Netscape and Sun Microsystems, whereby Netscape used the name JavaScript, a Sun trademark,[1] in return for bundling Sun's Java runtime with the popular Netscape Browser[2]. JavaScript was intended as a complement to Java and so was designed to look similar.

When JavaScript code is embedded in HTML pages, web browsers will execute the JavaScript upon loading the web page, and some Javascript may execute when the user interacts with elements in the web page. The JavaScript within HTML may also execute in response to user actions on the page. Since in some cases JavaScript may be disabled in the web browser's options, well-designed HTML pages must be functional even if the JavaScript within them is not allowed to execute.

JavaScript has seen several versions since its initial introduction with Netscape Navigator 2.0 in 1995 and the latest version now include new features making it a more robust scripting language. JavaScript script received an added boost when the browser started to expose more of the document object model (DOM) and allowed dynamic changes to the DOM; HTML elements became available to JavaScript programmers, as were the events allowing JavaScript coded functions to handle those events. This provided a better user experience for web surfers. Allowing the HTML document to manipulated after the page was served and/or based on user interactions made JavaScript important for the world wide web.

The use of JavaScript to communicate in the background with a web server, and then to update small parts of an HTML page asynchronously without the delay or flashing associated with postback (in which the web server sends the browser a completely new HTML page) is broadly called Ajax. In fact, using JavaScript in this manner is so complex that many programmers do not work with JavaScript directly but instead, use one of many Ajax toolkits which group JavaScript into higher functions.

JavaScript supports all the structured programming syntax of C (e.g., if statements, while loops, switch statements, etc.). JavaScript is almost object-based. JavaScript relies on a run-time environment.

References