SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jun 2000
    Location
    Yeppoon, Australia
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    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:

    http://www.cqnet.com.au/~user/fitzhood/menu/

    PS. Sorry about the messy first post.
    Last edited by mr_than; Jul 9, 2001 at 07:56.
    Knowledge is knowing that a tomatoe is a fruit; wisdom is not putting it in a fruit salad.

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Two things...

    1) If you havea large chunk of code such as this, you might consider posting a LINK to it instead of posting the entire codebase.

    2) Would you mind going in and taking off the <code> tags so that it does not bust the page width? It's perfectly acceptable to have the code wrap in the interest of people reading the page.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •