From: Eric G. <egr...@ho...> - 2000-11-02 22:43:06
|
True, it is bad practice to name a class instance with the actual class name. I'll correct this error in my code. Now I need some clarification on call hierarchy. Is the DynAPI.onLoad call before the var myPhotoAlbum = null;? I thought that the JavaScript engine would create a global variable out of myPhotoAlbum when the browser parses the page and when the onLoad function is called it would assign the PhotoAlbum to this global variable. Is this correct? Does declaring a variable inside the onLoad function mean it's global to the document? Eric scottandrew Wrote: You've effectively destroyed the PhotoAlbum constructor object with this line: var PhotoAlbum = null; Also, you shouldn't name a variable after a constructor: PhotoAlbum = new PhotoAlbum(); You're basically saying "take the PhotoAlbum constructor and make it a PhotoAlbum." Try this instead: MyPhotoAlbum = new PhotoAlbum(); _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. |