open window with new content type

J

John Smith

Is it possible to open a new window with window.open and set the content
type to be text/plain. I just want to write some text in to it. It seems to
default to test/html so all the spaces etc are concatenated. Setting the
content type would do it, but there does not seem to be a method call to set
it.

Thanks

Jon
 
R

Randy Webb

John Smith said the following on 6/14/2006 5:31 AM:
Is it possible to open a new window with window.open and set the content
type to be text/plain. I just want to write some text in to it. It seems to
default to test/html so all the spaces etc are concatenated. Setting the
content type would do it, but there does not seem to be a method call to set
it.

No, you can't set the content type that way. If you want to write plain
text and not lose your spacing then insert it into a <pre> tag. Or, wrap
your text in <pre> tags and insert that HTML.
 
R

Richard Cornford

John said:
Is it possible to open a new window with window.open and set the
content type to be text/plain. I just want to write some text in to it.
It seems to default to test/html so all the spaces etc are
concatenated. Setting the content type would do it, but there does
not seem to be a method call to set it.

Some browsers have supported MIME types as arguments to - document.open
-, but not many so generally the answer would be no. If you wrap your
text in <PRE> ... </PRE> its white space formatting will be preserved.

Richard.
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top