Saving a dynamic page

J

James

Situation: I have a page, built using document.write(). When I hit
'save as', IE goes and saves the contents of 'about:blank' to that
file, rather than saving the HTML it's displaying in the window. Does
anyone know how to get around this?
 
J

Jc

James said:
Situation: I have a page, built using document.write(). When I hit
'save as', IE goes and saves the contents of 'about:blank' to that
file, rather than saving the HTML it's displaying in the window. Does
anyone know how to get around this?

You could generate the page server-side. If you're just trying to look
at what the completed output looks like you could
alert(document.body.innerHTML); or dump it into a textarea for debug
purposes.
 
J

James

Thanks, but I need to enable users to save the output to a file, and
can't do this server-side. It seems the workaround is to tell users to
select 'HTML only' rather than 'whole page' when saving from IE, which
makes IE save the actual page it has rather than going back to the URL
it thinks the page is from.
 
J

Jeff

Use the MS Script Editor included free with MS Office 2002 and above,
for debugging Internet Explorer (IE).

This subject is of great interest to many JS developers, as there is no
obvious, low cost way to do sophisticated debugging in
IE6 other than to use the debugger described below, which is horribly
documented otherwise. I feel debugging is an important aspect of
projecting the useability of the language and needs to be made more
clear for new users.


Jeff Papineau
(e-mail address removed)


<FAQENTRY>

This is a page that describes how to install and use the MS Script
Editor to debug Javascript in Internet Explorer ( IE ). It has a
powerful debugger built into it that works really well for developers
supporting IE5+. This debugger/editor included with most versions of
Microsoft Office.

http://www.mandala.com/javascript/debug_javascript.html

..NET programmers may have better tools (VStudio) but this comes in
really handy for anyone developing with JSP and PHP and other dynamic
scripting languages which embed javascript, as well as any HTML page
using Javascript in Internet Explorer that needs a (almost) free
debugging environment.

</FAQENTRY>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top