?
Solved

How to set content type for a document

Posted on 2003-03-06
3
Medium Priority
?
3,022 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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

765 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