From: Matthew A. S. <ms...@go...> - 2001-02-06 17:57:37
|
I don't know if this is actually the problem but I usually throw a "return false" in the onclick method to prevent strange behavior by Netscape and sometime IE... change your setHTML line to this and see if it helps: myLayer.setHTML('<a href="#" onClick="myLayer.setHTML(\'Updated content\');return false">Initial content</a>') -- Matthew -----Original Message----- From: dyn...@li... [mailto:dyn...@li...]On Behalf Of Daniel Aborg Sent: Tuesday, February 06, 2001 9:13 AM To: dyn...@li... Subject: [Dynapi-Dev] Strange behaviour with setHTML/onClick in NS4.7 Win32 Hi! I've been playing around a bit with DynAPI II, and ran into a rather strange behaviour under Netscape 4.7. Basically, if you do setHTML on a layer from within an onClick event set on a link in the layer, the browser will also try to load a garbage page. This sample page produces the mentioned result on my NS4.7 platform: -------------------->8-------------------- <html> <head> <title>Strange behaviour?</title> <script language="javascript" src="dynapi/src/dynapi.js"></script> <script language="javascript"> <!-- DynAPI.setLibraryPath('dynapi/src/lib') DynAPI.include('dynapi.api.*') DynAPI.onLoad = function() { myLayer = new DynLayer(null, 100, 100, 200, 50, 'silver') myLayer.setHTML('<a href="#" onClick="myLayer.setHTML(\'Updated content\')">Initial content</a>') DynAPI.document.addChild(myLayer) } // --> </script> </head> <body> </body> </html> -------------------->8-------------------- Any ideas as to what might be the problem here? I'm rather new to DynAPI II, so please do tell me if there's something I've overlooked. Thanks! /Daniel -- Daniel Aborg <dan...@ne...> +44-(0)7765-961155 _______________________________________________ Dynapi-Dev mailing list Dyn...@li... http://lists.sourceforge.net/lists/listinfo/dynapi-dev |