spacer
Yehuda Shiran January 20, 2002
The Multiple States of XML Loading
Tips: January 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint