From: Scott A. L. <sc...@sc...> - 2000-11-02 22:09:14
|
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(); scottandrew Eric Gravel wrote: > > I encountered a rather interesting problem today which in my opnion should > not be happening. > > This is the error message generated by Netscape 4.75. This doesn't occur in > IE 5. Only Netscape. > > JavaScript Error: > file:/d%7C/egravel_fl/Amsterdam2000/index.html, line 52: > > PhotoAlbum is not a constructor. > > Here's the code: > > <html> > <head> > <!-- Include the Dynamic HTML API Object library --> > <script language="Javascript" src="../DynAPI/dynapi.js"></script> > <script language="Javascript"> > <!-- > DynAPI.setLibraryPath("../DynAPI/"); > DynAPI.include("core.api.dynlayer.js"); > DynAPI.include("core.api.browser.js"); > DynAPI.include("core.api.dyndocument.js"); > DynAPI.include("PhotoAlbum.js", "./"); > > var PhotoAlbum = null; > > DynAPI.onLoad = function() { > PhotoAlbum = new PhotoAlbum(); > PhotoAlbum.setBgColor( "#000000" ); > PhotoAlbum.setSize( 200, 200 ); > > DynAPI.document.addChild(PhotoAlbum); > } > //--> > </script> > </head> > > ... > > PhotoAlbum.js: > > function PhotoAlbum() { > this.test= 1; > return this; > } > PhotoAlbum.prototype = new DynLayer; > > If you comment the line "var PhotoAlbum = null;" everything works fine. Why > is that? > > Eric > > _________________________________________________________________________ > 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. > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help |