By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,400 Members | 1,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,400 IT Pros & Developers. It's quick & easy.

change iframe contenttype

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a


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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.