change iframe contenttype

J

jonam

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-
 
I

Ivo

jonam said:
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').document){
open('text/plain');write('<b>hello</b> jonam');close();
}

and

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

Perhaps it may provide a clue,
Ivo
 
M

Martin Honnen

jonam said:
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')
 
J

jonam

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-
 
L

Lasse Reichstein Nielsen

Martin Honnen said:
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
 

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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top