473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

change iframe contenttype

All,

I would like to display some xml (generated on the client side) within
an iframe on my ASP page and let IE handle the xml display with + -
color coding etc.

My client side jsvascript writes XML to this iframe dynamically (if i
do a view source, I see the XML alright). However, IE does not render
it nornally (+ - color coding etc).

How do I set the content type to "text/xml" so IE will handle the
display of XML within this iframe? Pl note that I do not want to
create a separate page and set the iframe's src to this page.

Thanx in advance!

-j-
Jul 20 '05 #1
4 15632
Ivo
"jonam" <ey*****@hotmail.com> wrote
I would like to display some xml (generated on the client side) <snip>
How do I set the content type to "text/xml" so IE will handle the
display of XML within this iframe?


I haven't checked the details on xml and iframes, but when writing into new
windows I notice quite a difference in my IE between

with(open('','pop','resizable,scrollbars').documen t){
open('text/plain');write('<b>hello</b> jonam');close();
}

and

with(open('','pop','resizable,scrollbars').documen t){
open('text/html');write('<b>hello</b> jonam');close();
}

Perhaps it may provide a clue,
Ivo
Jul 20 '05 #2


jonam wrote:
I would like to display some xml (generated on the client side) within
an iframe on my ASP page and let IE handle the xml display with + -
color coding etc.

My client side jsvascript writes XML to this iframe dynamically (if i
do a view source, I see the XML alright). However, IE does not render
it nornally (+ - color coding etc).

How do I set the content type to "text/xml" so IE will handle the
display of XML within this iframe? Pl note that I do not want to
create a separate page and set the iframe's src to this page.


There was a time when browsers like Netscape 4 supported
winOrFrameObject.document.open('mime-type-here')
but I don't think that either IE6 or Netscape 7 supports
document.open('text/xml')

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3
Thanx for a prompt response, Ivo. MSDN says that 'text/html' is the
only option.

I need to change the content type of the iframe to 'text/xml' via a
client side javacript. I really hope someone had encountered this
problem before and was able to solve it.

-j-
Jul 20 '05 #4
Martin Honnen <ma*******@yahoo.de> writes:
There was a time when browsers like Netscape 4 supported
winOrFrameObject.document.open('mime-type-here')
but I don't think that either IE6 or Netscape 7 supports
document.open('text/xml')


According to MSDN, IE does. It's not part of the W3C DOM though,
probably because you decide the type when you create the document
element, not when you open it for writing.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hqi | last post by:
Hi I'm src: <TD WIDTH=559 HEIGHT=100%> <script language="JavaScript"> document.write("<iFRAME WIDTH=559 height=100% SRC='dane.html'></iframe> "); ... I would like to change size (HEIGHT i...
2
by: google | last post by:
I have a HTML file that contains an iframe. The HTML file is served by one server. The iframe contains a link to a completely different server. My question is, can any action in the iframe (such...
5
by: jim.frantzen | last post by:
You have an active XMLHTTP request on the main page (localhost/App1/index.aspx) The XMLHTTP request takes about 60 seconds to receive a response back from localhost/App1/getxml.aspx. You have an...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
4
by: Jaco | last post by:
Hey, Maybe I am in the wrong newsgroup. I am writing an browserapplication. In the webpage I have 2 parts a fixed part and a variable part. The variable part is an IFRAME. If I press a button in...
1
by: Scott Nichols | last post by:
Hello, I have an asp.net application. The application dynamically creates an invoice. It is important to see and approve the invoice before it is updated in the database. So...I was...
0
by: NeilG | last post by:
Hi, I have an ASPX page with a literal control on the page. The page structure is like a frameset (but I dont use frames, this is just to give you an idea of how it looks) with records down the...
1
by: navi | last post by:
I have an iframe in which the source is an aspx page that retrieves a pdf and displays it. Upon page load, it clears the headers and sends the following: Content-Disposition: inline;...
2
by: Radu | last post by:
Hi, I have a "select" control named "cboSelectScorecardType", defined as <select id="cboSelectScorecardType" size="1" runat="server"> </select> which shows a list of files on my drive. It...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.