Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Workshop 497

17



  1. Events are special actions triggered by things happening in the system (windows
    opening, pages being loaded, forms being submitted) or by reader input (text being
    entered, links being followed, check boxes being selected). Using JavaScript, you
    can perform different operations in response to these events.

  2. The number 0 is false, and the string "false" is true. The only false values are
    0 , null, an empty string, undefined, NaN (not a number), and the Boolean value
    false itself.

  3. The var statement is used to define a local variable inside a function.

  4. Methods are associated with a specific object, and functions are standalone routines
    that operate outside the bounds of an object.


Exercises



  1. If you haven’t done so already, take a few minutes to explore the documentation
    for JavaScript at https://developer.mozilla.org/en-US/docs/Web/JavaScript. See
    whether you can find out what enhancements were included in the latest version of
    JavaScript that weren’t included in earlier versions.

  2. Find a simple JavaScript script somewhere on the Web—either in use in a web
    page or in an archive of scripts. Look at the source code and see whether you can
    decode its logic and how it works.

Free download pdf