Event information

Event handler parameters

Standards information

Remarks

You can use the IHTMLLinkElement::readyState property to query the current state of the element when the HTMLControlElementEvents::onreadystatechange event fires.

All elements expose an HTMLControlElementEvents::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 HTMLControlElementEvents::onreadystatechange event when a DHTML Behavior is attached.

When working with behaviors, wait for the HTMLControlElementEvents::onreadystatechange event to fire and verify that the IHTMLLinkElement::readyState property of the element is set to complete to ensure that the behavior is completely downloaded and applied to the element. Until the HTMLControlElementEvents::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.