Forum Moderators: open

Message Too Old, No Replies

Dynamically writing an XML document into IE using script

Dynamically writing an XML document into IE using script

         

joshie76

10:12 am on Jan 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You know how when you open an XML document in IE it's all syntax highlighted and has the collsible node bits?

Well I want to do that in an iframe but generate the document source from script...

I've tried this:

<iframe name="myFrame">
</iframe>
<script type="text/javascript">
window.myFrame.document.write('<?xml version="1.0"?>');
window.myFrame.document.write('<test>hello</test>');
window.myFrame.document.close();
</script>

But it just shows the source as HTML and not xml - is there any way to set the mimetype or anything using script? Any ideas?

J

<added>
When I posted it changed
window . m y Window.document.close() (without the extra spaces)
to:
windoWebmasterWorldindow.document.close();

Weird...
</added>

korkus2000

1:00 pm on Jan 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am not sure that the Javascript engine will write anything but an html type document. I would be interested in seeing javascript create different type of file on the fly.

When I posted it changed
window . m y Window.document.close() (without the extra spaces)
to:
windoWebmasterWorldindow.document.close();

Weird...

Thats the WebmasterWorld filter. Like trying to write LaWebmasterWorlder which should be L-a-w-n-m-o-w-e-r.

gsx

1:58 pm on Jan 7, 2003 (gmt 0)

10+ Year Member



HTML only.

You are trying to send a server-side process to be run on the client-side machine.