Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Component Development

createEventObject Method


This document describes technologies available in the Internet Explorer 5 Beta. While we encourage you to evaluate these features and to send us your feedback, please note that these features are subject to change.

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>
This feature requires Microsoft® Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

See Also

DHTML Behaviors, Implementing DHTML Behaviors in Script


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site