Results 1 to 2 of 2
Jul 9, 2001, 08:07 #1
- Join Date
- Jun 2000
- Yeppoon, Australia
- 0 Post(s)
- 0 Thread(s)
document.write overwriting document ???
Hi there, this is the weirdest thing I have ever seen. I have this script which is mostly dynamically generating the entire page to create a dynamic menu. The actual DHTML menu script I'm using is one that I've edited and added to from webmonkey.
In an attempt to make it a little for those updating it to do so easily, and because it is a very structured page I thought I'd have a go at dynamically generating the HTML for it... almost all of the page is created with a document.write statements which use data from a user defined object that represents a menu.
Anyway, when I run the thing in IE (NN isn't quite happening yet, seems to like crashing sometimes) and look at the code of the page after the obligitaory error messages I see that all MY code has been overwritten with the output of the script (which I must admit seems to be pretty right ) with addition of a space between every character and all the CTRL/LF's as well. In doing this it deletes all the functions and just about everything else that makes it work. I am completely stumped.
To add to the problem, some of the scoping of the variables seems to be wrong. Is an object member with the same name distinct from a normal document var?? I would have thought yes but I seem to be having a problem with that too.
The way things are going I think I will just create this page statically but any input into these goings on would be appreciated.
here is a link to the file:
PS. Sorry about the messy first post.
Last edited by mr_than; Jul 9, 2001 at 08:56.Knowledge is knowing that a tomatoe is a fruit; wisdom is not putting it in a fruit salad.