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>