spacer
Yehuda Shiran January 30, 2002
Waiting for XML Loading
Tips: January 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

There are two ways to list the content of the DOMDocument object. Our first display shows only the data-related elements of the object. You accomplish this by asking for the xml property of the root element, xmldoc.documentElement. The load1() function demonstrates this presentation:

function load1() {
  var xmldoc;
  xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
  xmldoc.async = false;
  xmldoc.load("mydvd.xml");
  alert(xmldoc.documentElement.xml);
}
Try it now. You should get the mydvd store file, with just the data elements.

Our second display includes all items in the XML file, including the directives in the beginning of the file, such as the XML version or the XSL file name. You accomplish this by asking for the xml property of the DOMDocument object. The load2() function demonstrates this presentation:

function load2() {
  var xmldoc;
  xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
  xmldoc.async = false;
  xmldoc.load("mydvd.xml");
  alert(xmldoc.xml);
}
Try it now. You should get the mydvd store file, with all initial settings and directives.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business