This is my first assignment in the JavaScript for Beginners class, Spring 2001, at Virtual University.
I used document.write and activated the cloaking device to tell older browsers to ignore the javascript if they cannot read it.
In Javascript, the comment tags are similar to HTML's "comment" tag
but are written with two // (slashes) before the closing -->.
JAVASCRIPT RULES
Rule 1.
Capitalization - JavaScript is case-sensitive.
Rule 2.
Opening symbols require matching closing symbols: open and closed symbols must work in pairs, e.g., braces, parentheses, and single or double quotes. Pay particular attention when nesting items.
Rule 3.
Use comments to document coding and note what script is doing. Invisible to JS is anything between the double slashes and the end of the line character that gets inserted when your press the RETURN or ENTER key.
Rule 4.
JavaScript scripts typically consist of a series of statements. Every statement has the same structure: A statement often starts on its own line with the first item being a command, immediately followed with information after the statement (i.e., the value) and lastly, a trailing semi-colon. If a series of statements is strung together, a semi-colon serves as both the beginning and ending marker.
Rule 5.
"Command blocks" are groups of statements somewhat like a paragraph. They are treated like a single entity and follow the same structure: A command block starts on its own line with the first item an open { (brace) followed by one or more indented statements describing a series of actions that follow the standard structure of a statement, e.g., command, information, semi-colon and, lastly, a closing } brace on its own line. (See "Hello World" and "Welcome to our Site" above.)
Back to the Top