?
Solved

How to set content type for a document

Posted on 2003-03-06
3
Medium Priority
?
3,024 Views
Last Modified: 2008-02-01
I am opening a new window and writing some content in the new window. Anyone know how to set the content type of the window through javascript.

For example I want to set the content-type to text/plain for displaying ordinary text, text/html for html content and text/xml for xml. Based on clients selection just I want to set these values in the client side itself.



0
Comment
Question by:augustinejk
2 Comments
 
LVL 4

Accepted Solution

by:
jonnal earned 200 total points
ID: 8079642
hi

document.open("text/plain")
or
document.open("text/html")
document.write(stuff)

you can also use document.open("text/html","replace")to overwrite in history of this page.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10097792
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: jonnal {http:#8079642}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question