document.readyState属性

说 明 

这个属性是只读的,传回值有以下的可能: 

0-UNINITIALIZED:XML 对象被产生,但没有任何文件被加载。 
1-LOADING:加载程序进行中,但文件尚未开始解析。 
2-LOADED:部分的文件已经加载且进行解析,但对象模型尚未生效。 
3-INTERACTIVE:仅对已加载的部分文件有效,在此情况下,对象模型是有效但只读的。 
4-COMPLETED:文件已完全加载,代表加载成功。 
  
  
范 例 
alert("The readyState property is " + xmlDoc.readyState); 


document.readyState几种状态及示例 - gaoyusi - My code life < script language = " javascript " >
document.readyState几种状态及示例 - gaoyusi - My code life
document.readyState几种状态及示例 - gaoyusi - My code life
if  (document.readyState == " complete " )
document.readyState几种状态及示例 - gaoyusi - My code life
{
document.readyState几种状态及示例 - gaoyusi - My code life        AdjustImageSize();
document.readyState几种状态及示例 - gaoyusi - My code life}

document.readyState几种状态及示例 - gaoyusi - My code life
else
document.readyState几种状态及示例 - gaoyusi - My code life
{
document.readyState几种状态及示例 - gaoyusi - My code life        document.onreadystatechange 
= function()
document.readyState几种状态及示例 - gaoyusi - My code life        
{
document.readyState几种状态及示例 - gaoyusi - My code life           
document.readyState几种状态及示例 - gaoyusi - My code life                
if (document.readyState == "complete")
document.readyState几种状态及示例 - gaoyusi - My code life                
{
document.readyState几种状态及示例 - gaoyusi - My code life                        AdjustImageSize();
document.readyState几种状态及示例 - gaoyusi - My code life                }

document.readyState几种状态及示例 - gaoyusi - My code life        }

document.readyState几种状态及示例 - gaoyusi - My code life}

document.readyState几种状态及示例 - gaoyusi - My code life
document.readyState几种状态及示例 - gaoyusi - My code life
function  AdjustImageSize()
document.readyState几种状态及示例 - gaoyusi - My code life
{
document.readyState几种状态及示例 - gaoyusi - My code life        
var imageWidth = document.all["SendPic"].width;
document.readyState几种状态及示例 - gaoyusi - My code life        
var imageHeight = document.all["SendPic"].height;
document.readyState几种状态及示例 - gaoyusi - My code life        
document.readyState几种状态及示例 - gaoyusi - My code life        
if (imageWidth == 0 && imageHeight == 0)
document.readyState几种状态及示例 - gaoyusi - My code life        
{
document.readyState几种状态及示例 - gaoyusi - My code life                document.write (
"图片下载失败,请刷新!");
document.readyState几种状态及示例 - gaoyusi - My code life                
return;
document.readyState几种状态及示例 - gaoyusi - My code life        }

document.readyState几种状态及示例 - gaoyusi - My code life        
document.readyState几种状态及示例 - gaoyusi - My code life        
if (imageWidth > 160 || imageHeight > 160)
document.readyState几种状态及示例 - gaoyusi - My code life        
{
document.readyState几种状态及示例 - gaoyusi - My code life                
if (imageWidth > imageHeight)
document.readyState几种状态及示例 - gaoyusi - My code life                
{
document.readyState几种状态及示例 - gaoyusi - My code life                        k 
= 160 / imageWidth;
document.readyState几种状态及示例 - gaoyusi - My code life                        imageHeight 
= imageHeight * k;
document.readyState几种状态及示例 - gaoyusi - My code life                        imageWidth 
= 160;
document.readyState几种状态及示例 - gaoyusi - My code life                }

document.readyState几种状态及示例 - gaoyusi - My code life                
else
document.readyState几种状态及示例 - gaoyusi - My code life                
{
document.readyState几种状态及示例 - gaoyusi - My code life                        k 
= 160 / imageHeight;
document.readyState几种状态及示例 - gaoyusi - My code life                        imageWidth 
= imageWidth * k;
document.readyState几种状态及示例 - gaoyusi - My code life                        imageHeight 
= 160;
document.readyState几种状态及示例 - gaoyusi - My code life                }

document.readyState几种状态及示例 - gaoyusi - My code life                
document.readyState几种状态及示例 - gaoyusi - My code life                document.all[
"ImgResized"].value = "1";
document.readyState几种状态及示例 - gaoyusi - My code life        }

document.readyState几种状态及示例 - gaoyusi - My code life        
document.readyState几种状态及示例 - gaoyusi - My code life        document.all[
"SendPic"].width = imageWidth;
document.readyState几种状态及示例 - gaoyusi - My code life        document.all[
"SendPic"].height = imageHeight;
document.readyState几种状态及示例 - gaoyusi - My code life        
document.readyState几种状态及示例 - gaoyusi - My code life        document.all[
"ImgWidth"].value = imageWidth;
document.readyState几种状态及示例 - gaoyusi - My code life        document.all[
"ImgHeight"].value = imageHeight;
document.readyState几种状态及示例 - gaoyusi - My code life}

document.readyState几种状态及示例 - gaoyusi - My code life
script >

你可能感兴趣的:(document.readyState属性)