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

Chapter 2. Script Setup > Generating HTML and Printing Output

2.3. Generating HTML and Printing Output

When you create a program in any language, the first thing you want to see is the output of the program displayed on a screen. In the case of JavaScript, you'll see your output in the browser window. Of course, browsers use HTML to format output. Although JavaScript doesn't understand HTML per se, it can generate HTML output with its built-in methods, write() and writeln().

2.3.1. Strings and String Concatenation

A string is a character or set of characters enclosed in matching quotes. Since the methods used to display text take strings as their arguments, this is a good time to talk a little about strings. See Chapter 9, “JavaScript Core Objects,” for a more complete discussion. All strings must be placed within a matched set of either single or double quotes; for example:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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