Hi,
I posted this on Friday, but didn't get a satisfactory answer. Therefoer I
post it again with some clarifications.
I want to write a script that (run from a file on the local HD,
therefore I can't use server-side stuff) reads another local html-file
into a variable, then make some changes to it, and then output the result
in a way that makes it simple for the user to save it again. And all of
this should run in any current browser, not just IE.
I managed to access the code of the current document by
code = document.documentElement.innerHTML
But when I open another window with the file I want to edit, all I get is
<head></head><body></body>
if I do code = otherWindow.document.documentElement.innerHTML
Is there no easy way to do this?!?
For the output I tried to do document.write in an output window, but I
can't save the code I generate there, all I get is the sourcecode of my
script page (the opener of the page I try to save). I don't want to
save under script-control, but manually by clicking Save-As. If there
is no simple solution to this, I still can write the code to a textarea
and have the user copy and paste it into an editor. So the most
important part is reading the code. But I'd like to have it a bit more
comfortable. Any hints?
Oh, just in case that matters, I'm using Galeon on Linux.
But I want this to run also in other browsers, so I can't use
browser-specific code. If nothing else helps and you can help me with
specific code for different browsers I could probably use browser
detection, but I would prefer to keep it simple.
I hope someone out there can help me.
Thanks