Returns the current status of the XML file.
Basic syntax
IntState = xmlDocument. readyState;
Description
This attribute is read-only and the returned value may be:
0-UNINITIALIZED: XML objects are generated, but no files are loaded.
1-LOADING: The LOADING program is in progress, but the file has not started parsing.
2-LOADED: some files have been LOADED and parsed, but the object model has not yet taken effect.
3-INTERACTIVE: only valid for some loaded files. In this case, the object model is valid but read-only.
4-COMPLETED: the file is fully loaded, indicating that the file is successfully loaded.
Example
Alert ("The readyState property is" + xmlDoc. readyState );
<Script language = "javascript">
If (document. readyState = "complete ")
{
AdjustImageSize ();
}
Else
{
Document. onreadystatechange = function ()
{
If (document. readyState = "complete ")
{
AdjustImageSize ();
}
}
}
Function AdjustImageSize ()
{
Var imageWidth = document. all ["SendPic"]. width;
Var imageHeight = document. all ["SendPic"]. height;
If (imageWidth = 0 & imageHeight = 0)
{
Document. write ("image download failed. Please Refresh! ");
Return;
}
If (imageWidth> 160 || imageHeight> 160)
{
If (imageWidth> imageHeight)
{
K = 160/imageWidth;
ImageHeight = imageHeight * k;
Image Width = 160;
}
Else
{
K = 160/imageHeight;
ImageWidth = imageWidth * k;
ImageHeight = 160;
}
Document. all ["ImgResized"]. value = "1 ";
}
Document. all ["SendPic"]. width = imageWidth;
Document. all ["SendPic"]. height = imageHeight;
Document. all ["ImgWidth"]. value = imageWidth;
Document. all ["ImgHeight"]. value = imageHeight;
}
</Script>