• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. Script Setup > Syntactical Details

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 in order 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, especially if you know Perl or languages derived from C. When you write JavaScript programs, you have to deal with HTML rules as well as JavaScript rules, since 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 renderer will not care. But JavaScript names, such as variables, keywords, objects, functions, 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).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint