document有一个状态表示页面是否加载完毕readyState
Retrieves a value that indicates the current state of the object.
Syntax
HTML N/A
Scripting [ sState = ] object.readyState
Possible Values
sState String that receives one of the following values.uninitialized Object is not initialized with data.
loading Object is loading its data.
loaded Object has finished loading its data.
interactive User can interact with the object even though it is not fully loaded.
complete Object is completely initialized.
可以通过判断这个值来确定是否加载完毕。