onreadystatechange Property

       

Returns or sets a Variant that represents the value associated with the onreadystatechange event. For example, the Variant can represent a macro or procedure call that executes when the event has occurred. Read/write.

expression.onreadystatechange

expression   Required. An expression that returns a DispFPHTMLDocument object.

Example

The following example, which appears embedded in the <head> section of an HTML document, displays a message to the user when the ready state of the current document changes.

<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>

The <p> section code below calls the DisplayMessage procedure located in the <head> section of the document. When the ready state of the current document changes a message will be displayed.

<body>
<p onreadystatechange = "DisplayMessage"></p>
</body>