JavaScript Tutorials - Herong's Tutorial Examples - 2.33, by Herong Yang
First JavaScript - "Hello World!"
This section provides the first JavaScript tutorial example - 'Hello World!'.
The best way to learn JavaScript is to embed the JavaScript code in an HTML document and run it in a Web browser. Here is what I did to write and run my first JavaScript code - "Hello World!".
1. Enter the following HTML document with one line of JavaScript:
<html> <head><title>Hello World!</title></head> <body> <script type="text/javascript"> document.write('Hello World!'); </script> </body> </html>
2. Save this HTML document as Hello_World.html.
3. Open Hello_World.html in Web browser. You will see:
Hello World!
Congratulations, you have created and executed your first JavaScript successfully!
Table of Contents
►First JavaScript - "Hello World!"
Walking through the First JavaScript
ECMAScript Language Specification and JavaScript Dialects
Data Types, Variables and Expressions
Creating, Accessing, and Manipulating Arrays
Defining and Calling Functions
Web Browser Supporting JavaScript
Server-Side and Client-Side Web Scripting
Defining Your Own Object Types
Inheritance of Properties and Methods through the Prototype Object Chain
'jrunscript' - JavaScript Shell Command from JDK
Using Functions as "Function" Objects
Introduction to Built-in Object Types
W3C's Document Object Model (DOM) Specifications