返回或设置 Variant 类型的值,该值表示与 onreadystatechange 事件相关联的值。例如,Variant 可以代表当事件发生时执行的的某个宏或过程调用。可读写。
expression.onreadystatechange
expression 必选。返回 DispFPHTMLDocument 对象的表达式。
在以下示例中,在当前文档的准备状态更改时,将向用户显示一条消息。此示例内嵌在 HTML 文档的 <head> 节中。
<head>
<title>onreadystate change Example</title>
<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub DisplayMessage
'Displays message to user
MsgBox "This message is displayed when the ready state of the current document changes."
End Sub
-->
</script>
</head>
以下 <p> 节代码调用位于文档的 <head> 节中的 DisplayMessage 过程;在当前文档的准备状态更改时,将显示一条消息。
<body>
<p onreadystatechange = "DisplayMessage"></p>
</body>