Welcome to WebmasterWorld Guest from 23.22.46.195

Forum Moderators: open

JavaScript Headache - a call for help!

Netscape won't dynamically write my HTML into a layer!

   
7:42 am on Jul 9, 2001 (gmt 0)

10+ Year Member



I've spent about three days writing a simple tree menu script which works perfectly. I'm now doing some final tweaks and placing the code into my finished page - but there is a problem. (Isn't there always?!)

I'll try and explain this as simply as I can:

I have a layer (div) that contains a bit of JavaScript. This script calls a function in the <head> that dynamically writes out the menu using a series of document.write commands. The problem is Netscape writes nothing (fine in IE on Mac and PC). This error only occurs when the code sits in a layer. It's fine in a table.

Does anyone know what could be going wrong? Is there a known problem with Netscape/Layers etc?

I've done a bit of debugging by placing an alert in the function - so I know that is being called. It seems to stop working when it gets to the first document.write.

Any advice would be greatly appreciated.

Cheers.

10:28 am on Jul 9, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I seem to remember something about this. The workaround I remember is for document.write to actually write the DIV tag, instead of merely getting called from within the DIV.

Would this work in your case?

11:48 am on Jul 9, 2001 (gmt 0)

10+ Year Member



tedster - you truly are a star!!

Yes - the answer is to use JavaScript to write the div tags as well. Then netscape doesn't have a problem at all.

It took a bit of tweaking but got there in the end.

Many thanks

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month