homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

JavaScript Headache - a call for help!
Netscape won't dynamically write my HTML into a layer!

10+ Year Member

Msg#: 645 posted 7:42 am on Jul 9, 2001 (gmt 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.




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

Msg#: 645 posted 10:28 am on Jul 9, 2001 (gmt 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?


10+ Year Member

Msg#: 645 posted 11:48 am on Jul 9, 2001 (gmt 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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved