spacer
Yehuda Shiran January 20, 2002
The Multiple States of 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?

The DOMDocument object has a very extensive set of properties, methods, and events to deal with reading XML files and loading their data in. The readyState property can give direct feedback on the reading processes. Here are the possible values for readyState:

StateShort DescriptionLong Description
1LoadingPreparing to read the XML file. Did not try yet.
2LoadedReading and parsing the XML file. Object model still not available.
3InteractivePart of the XML file successfully parsed and read in. Object model partially available for read only.
4CompletedLoading of the XML file has been completed, successfully or unsuccessfully.

When you read an XML file successfully, the readyState property goes through all four states: 1,2,3, and 4. When you are unsuccessful in reading an XML file, the readyState property may skip 3 on some operating systems. Obviously, it is very difficult to know exactly when the readyState property changes its value. For this very purpose the DOMDocument object provides the onreadystatechange event handler.


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