Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving a DOM altered web page in Internet Explorer 6

    I have a webpage with a number of forms at the top of it. When these are filled in, new paragraphs/tables/links are written to the same page using JavaScript to manipulate and create new nodes.

    It was originally tested in Firefox, Netscape and IE6, and works perfectly in all three. The problem comes when the user attempts to save the altered version of the page, ie the one now containing a large amount of extra data. In all browsers other than IE, file->saveas saves a file that inclueds the altered DOM. IE on the other hand only includes the original HTML.

    Could anyone please suggest a work around for this, as using an alternative browser is not an option due to the constraints of the work's systems.

    Thanks.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't think there is one ...

    Is there a particular reason why you're concerned about pages saved like this? Maybe you could offer the data in another form - downloadable PDF maybe, something like that?
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    document.documentElement.outerHTML

    will return IE's internal representation of the page at the moment, which includes the on-the-fly DOM changes. You could use some ActiveX objects to write that string to a file.

  • #4
    New Coder
    Join Date
    Jan 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you both of you.

    Brothercake, the reason for using this method was that IE is about the only standard(ish) program we have running across the system. The purpose of the page is to allow easy updating of a document that is constantly being changed (hence why we couldn't use a pdf). It also has to be updated/altered by a number of people across the network. Its not an elegant solution, but hopefully it will work.

    Jkd, thanks for the outerHTML hint, with a bit of moulding it works beautifully. Unfortunatly I can't use activeX due to the system security but I've found a work around.

    Thanks again guys


  •  

    Posting Permissions

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