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

Part II: Using JavaScript with Web Pages > JavaScript Object-Oriented Programmi...

Chapter 8. JavaScript Object-Oriented Programming and the Document Object Model

CONTENTS>>

Up to this point, all discussion about objects has been in terms of building them or addressing different object properties and methods. In some ways, properties act like variables in that they can be assigned values, and the values assigned to them can change. Likewise, you saw that methods are functions associated with objects and their properties. More importantly, though, many disparate pieces of code can be brought together in an object that contains all the information that variables provide and the actions inherent in functions. By conceiving of an object as a collection of named properties with values that can be any type of data, you can see them as building block structures in a script. Keeping in mind that functions can be a type of data, they are called methods when they are the value of a property. Perhaps it might help to think of objects as coded modules that can help organize your scripts.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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