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

Chapter 1. An Overview of Javascript > JavaScript: Controlling the Machine

JavaScript: Controlling the Machine

When a Web browser is confronted with an HTML file, it goes through a simple but tedious process: it reads the file one line at a time, starting from (usually) the <html> tag at the top and finishing with the </html> tag at the bottom. Along the way, it might have to break out of this line-by-line monotony to perform some action based on what it has read. For example, if it stumbles over the <img> tag, the browser will immediately ask the Web server to ship out a copy of the graphics file specified in the src attribute.

The point here is that, at its core, a Web browser is really just a page-reading machine that doesn't know how to do much of anything else besides follow the instructions (the markup) in an HTML file. (For my own convenience, I'm ignoring the browser's other capabilities, such as saving favorites or bookmarks.)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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