Welcome to WebmasterWorld Guest from 184.72.177.182

Forum Moderators: open

Message Too Old, No Replies

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)

Junior Member

10+ Year Member

joined:Feb 28, 2001
posts:73
votes: 0


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 July 9, 2001 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


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 July 9, 2001 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 28, 2001
posts:73
votes: 0


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

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members