CSCI 121 - Lecture 9 - Introduction to JavaScript
Topics Covered
- History
- It is NOT java.
- Developed in 10 days in 1995 by Brendan Eich of Netscape.
- Adopted as a standard in 1996, 1997 by ECMA, with ECMAScript the name of the official standard.
- Competing client-side scripting alternatives existed until 2005 and were all but phased out by 2008 when most alternatives died off.
- Web 2.0 paradigm of development, Ajax as a standard, jquery and other libraries, HTML5 have lead to JavaScript as becoming a vital technology in the Internet Programming toolbox today.
- Adding JavaScript to a web page
- The <script> tag is used to define client-side script (JavaScript) within an HTML document (web page).
- The <script> element may contain either JavaScript code or it may point to a script file through its src attribute.
- Writing content to a web page dynamically
- JavaScript may write to a web page in several ways.
- The most rudimentary way is to use the document.write function of the Document Object Model (DOM).
- When called as the page is loaded, document.write appends.
- Beware: If called after the page is loaded document.write replaces all the page content.