Fires when the state of the object has changed.
void onreadystatechange( IHTMLEventObj *pEvtObj );
No return value.
The DISPID for this event is defined in mshtmdid.h. Use this value to identify the event handler when implementing IDispatch::Invoke.
Bubbles No Cancels No To invoke Change the ready state. Default action Signals the ready state of the document.
Event Object Properties
The IHTMLEventObj interface contains additional information about the current event. When the onreadystatechange event is fired, you can use the IHTMLWindow2::event property to retrieve an IHTMLEventObj interface. To obtain an alternate interface pointer such as IHTMLEventObj2 or IHTMLEventObj3, call QueryInterface on the object.
IHTMLEventObj::altKey Gets a value that indicates the state of the ALT key. IHTMLEventObj2::altKey Gets a value that indicates the state of the ALT key. IHTMLEventObj3::altLeft Gets a value that indicates the state of the left ALT key. IHTMLEventObj3::ctrlLeft Sets or retrieves the state of the left CTRL key. IHTMLEventObj3::shiftLeft Retrieves the state of the left SHIFT key. IHTMLEventObj::srcElement Gets the object that fired the event. IHTMLEventObj2::srcElement Gets or sets the object that fired the event. IHTMLEventObj::type Gets the event name from the event object. IHTMLEventObj2::type Gets or sets the event name from the event object.
Refer to the specific event object for additional event properties.
You can use the readyState property to query the current state of the element when the HTMLMapEvents2::onreadystatechange event fires.
All elements expose an HTMLMapEvents2::onreadystatechange event. The following objects always fire the event because they load data: applet, document, frame, frameSet, iframe, img, link, object, script, and xml elements. Other objects will only fire the HTMLMapEvents2::onreadystatechange event when a DHTML Behavior is attached.
When working with behaviors, wait for the HTMLMapEvents2::onreadystatechange event to fire and verify that the readyState property of the element is set to
completeto ensure that the behavior is completely downloaded and applied to the element. Until the HTMLMapEvents2::onreadystatechange event fires, if you use any of the behavior-defined members before attaching the behavior to the element, a scripting error can result, indicating that the object does not support that particular property or method.