home / experts / javascript / column78 |
|
Structuring your ApplicationOur demo application includes three applications in one:
The general structure of the application page is similar to what we presented in our previous column, Netscape 6, Part VI: Object-Oriented DOCJSLIB 1.2. Read the other column carefully to get acquainted with the principles of object-oriented programming in general and object-oriented JavaScript in particular. We first load the browser sniffer:
We then load the browser-independent superclass object:
We decide which subclass object to load in the following javascript code:
We load all four subclass objects, for Internet Explorer 4.x, Internet Explorer 5.x, Netscape Navigator 4.x, and Netscape 6 in
So far, we have loaded object constructor in the form of function definitions. We create the proper subclass and an instance of it next:
The rest of the page includes the code for the three applications. To make the code more readable, we enclosed each application in a separate Next: use DOCJSLIB 3.1 in programming Tic-Tac-Toe |
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: February 26, 2001
Revised: February 26, 2001
URL: http://www.webreference.com/js/column78/2.html