Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 3.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2002, 04:20 AM   PM User | #1
flyclassic
New Coder

 
Join Date: Sep 2002
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
flyclassic is an unknown quantity at this point
how to display xml document without using alert("")

var objDOM;
objDOM = new ActiveXObject("MSXML.DOMDocument");
objDOM.async = False;
objDOM.load("aflooding.xml");
alert(objDOM.xml);

my script is as follow , i would like to display my XML file. I've read up from some books and it always uses Alert(objDOM.xml), but i would like a direct output to the page instead of a popup.
Is there anyway you guys now?
flyclassic is offline   Reply With Quote
Old 09-14-2002, 07:23 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,428
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
How about opening a popup window?

var popup=window.open("","")
popup.document.write("<pre><![CDATA["0
popup.document.write(objDOM.xml.toString())
popup.document.write("]]></pre>")
popup.document.close()

The browser may not like the <![CDATA[...]]> tags. If it doesn't, try <xmp>...</xmp>.

Another option is a textarea.

var popup = window.open("","")
popup.document.write("<html><head><title></title></head>")
popup.document.write("<body><form><textarea cols='60' rows='30'>")
popup.document.write(objDOM.xml.toString())
popup.document.write("</textarea></form></body></html>")
popup.document.close()

Finally, you could use a textarea directly in your master page.

document.forms.formName.textAreaName.value = objDOM.xml.toString()

HTH
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:41 AM.


Advertisement
Log in to turn off these ads.