HTML and CSS Reference
In-Depth Information
4. Or you can type the URL (complete address) in the navigation bar of your
browser as shown here. (Note the .html extension appears in the URL.)
2.2 Syntactical Details
Rules, rules, rules. Just like English, French, or Chinese, all programming languages
have their rules. Many of the rules are similar and many have individual quirks, but to
do anything at all, you have to obey the rules, or your program simply won't work. If
you have experience programming in other languages, you will find the JavaScript rules
and syntax quite familiar. When you write JavaScript programs, you have to deal with
HTML rules (and CSS rules), as well as JavaScript rules, because JavaScript does not
stand alone.
2.2.1 Case Sensitivity
The HTML tags in a document are not case sensitive. If you type the title tag as <title> ,
<Title> , <TItle>, or any combination of upper or lowercase characters, the HTML ren-
derer will not care. But JavaScript names, such as variables, keywords, objects, func-
tions, and so on, are case sensitive. If, for example, you spell the Boolean value true with
any uppercase letters (e.g., TrUE), JavaScript will not recognize it and will produce an
error or simply ignore the JavaScript code. Although most names favor lowercase, some
JavaScript names use a combination of upper and lowercase (e.g., onClick , Math.floor ,
Date.getFullYear ).
2.2.2 Free Form and Reserved Words
JavaScript ignores whitespace (i.e., spaces, tabs, and newlines) if the whitespace appears
between words. For example, a function name, such as onMouseOver() , toLowerCase() ,
or onClick(), cannot contain whitespace even though it consists of more than one word.
1. var name="Tom";
1 and 2 are equivalent statements
2. var
name =
"Tom";
3. onMouseOver()
3 and 4 are not the same
4. on Mouse Over()
 
 
 
 
Search WWH ::




Custom Search