change iframe contenttype

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jonam

    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-
  • Ivo

    #2
    Re: change iframe contenttype

    "jonam" <eydnehs@hotmai l.com> wrote[color=blue]
    > 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?[/color]

    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('','p op','resizable, scrollbars').do cument){
    open('text/plain');write(' <b>hello</b> jonam');close() ;
    }

    and

    with(open('','p op','resizable, scrollbars').do cument){
    open('text/html');write('< b>hello</b> jonam');close() ;
    }

    Perhaps it may provide a clue,
    Ivo


    Comment

    • Martin Honnen

      #3
      Re: change iframe contenttype



      jonam wrote:[color=blue]
      > 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.[/color]

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

      --

      Martin Honnen


      Comment

      • jonam

        #4
        Re: change iframe contenttype

        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-

        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: change iframe contenttype

          Martin Honnen <mahotrash@yaho o.de> writes:
          [color=blue]
          > There was a time when browsers like Netscape 4 supported
          > winOrFrameObjec t.document.open ('mime-type-here')
          > but I don't think that either IE6 or Netscape 7 supports
          > document.open(' text/xml')[/color]

          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 - lrn@hotpop.com
          DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          Working...