From: Mark P. <mar...@hi...> - 2000-11-15 09:08:03
|
Sam, I have encountered this error, but it dissappeared as I continued development on my widget. I think the solution is to not use the setURL method until the layer has been added to the DynAPI.document. By swopping the last 2 lines of your code, all should be OK. e.g DynAPI.onLoad = function ( ) { testlayer = new DynLayer(null,100,100,143,16,"#ffffff"); DynAPI.document.addChild(testlayer); testlayer.setURL("ext.html"); } Good Look Mark Sam Douglass wrote: > Hi, sorry to post a newbie question here, but I'm trying to > load an external HTML file into a dynlayer and am having a problem > that I don't think I saw addressed in the list archives available over > the Web. I have one simple layer into which I want to load a simple > external file: > > <SCRIPT LANGUAGE="JavaScript"><!-- > DynAPI.setLibraryPath('Core/lib2.0/') > > DynAPI.include('core.api.*') > DynAPI.include('core.ext.loadhtml.js') > > DynAPI.onLoad=function() { > testlayer = new DynLayer(null,100,100,143,16,"#ffffff") > testlayer.setURL("ext.html") > DynAPI.document.addChild(testlayer) > } > //--></SCRIPT> > > This works great in Netscape 4.73, but doesn't work in IE 5.0. I think I > tracked down the error, but I'm not sure what to do about it. In the > file > "core.ext.loadhtml.js" there is a property called > "DynAPI.setURL.current" > which appears to be initialized to null (last line of the file). This is > causing an error here on line 18, I think: > > 15: DynLayer.prototype.onLoad=function(e) { > 16: var lyr > 17: if (is.ie) { > 18: lyr=document.all[DynLayer.prototype.setURL.current].lyrobj > 19: lyr.elm.innerHTML=e > 20: } else if (is.dom) { > > I'm getting "document.all[...].lyrobj is not an object" which seems to > fit > with using a null object as a reference into the document.all[] array. > So > the "current" propery should be a layer id tag, but which one? Or am I > way > off on what's happening here? > > Anyway, if anybody read this far and knows how to make this work in > IE, I'd be immensely grateful for any help. If this is a known bug > that's > being worked on that's not up on SourceForge yet, or if I'm doing > something > stupid like not including the right files or something, sorry about the > dumb post, but I would still appreciate a heads up. Thanks! > > Sam Douglass > > PS The API is awesome, and tremendously useful! Thanks to the > development > team for all the hard work they've put into it. > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help |