Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Creates an event object to be used optionally in passing event context information to the EVENT element's fire method.
Syntax
oEvent = createEventObject ()
Return Value
Returns an event object.
Remarks
The same event object cannot be reused in multiple fire calls.
Note All properties of the event object created using createEventObject are read/write, including those that would be read-only in Dynamic HTML. This allows the Web author to set properties on the event object from the HTML Component (HTC) before firing the event.
Example
The following example is derived from a calculator behavior sample. Whenever the result changes, the behavior fires a custom onResultChange event back to the page, passing the result as an expando property of the event object.
Sample Code
<PUBLIC:EVENT NAME="onResultChange" ID="rcID" /> <SCRIPT LANGUAGE="JScript"> : function doCalc() { : oEvent = createEventObject(); oEvent.result = sResult; rcID.fire (oEvent); } </SCRIPT >Here's what the containing page looks like:
<HTML XMLNS:InetSDK> <HEAD> <style> @media all { InetSDK\:CALC {behavior:url(engine.htc)} } </style> </HEAD> <InetSDK:CALC id="myCalc" onResultChange="resultWindow.innerText=window.event.result"> <TABLE> <TR><DIV ID="resultWindow" STYLE="border: '.025cm solid gray'" ALIGN=RIGHT>0.</DIV></TR> <TR><TD><INPUT TYPE=BUTTON VALUE=" 7 "></TD> <TD><INPUT TYPE=BUTTON VALUE=" 8 "></TD> <TD><INPUT TYPE=BUTTON VALUE=" 9 "></TD> <TD><INPUT TYPE=BUTTON VALUE=" / "></TD> <TD><INPUT TYPE=BUTTON VALUE=" C "></TD> </TR> : </TABLE> </InetSDK:CALC> </HTML>
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.