www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
 event Object
event Object

Represents the state of an event, such as the element in which the event occurred, the state of the keyboard keys, the location of the mouse, and the state of the mouse buttons.

Members Table

The following table lists the members exposed by the event object.

Attributes/Properties
Show:
AttributePropertyDescription
Abstract Gets the Abstract content of the entry banner in an Advanced Stream Redirector (ASX) file by using the event object.
altKey Sets or retrieves a value that indicates the state of the ALT key.
altLeft Sets or retrieves a value that indicates the state of the left ALT key.
Banner Gets the Banner content of an entry in an ASX file using the event object.
button Sets or retrieves the mouse button pressed by the user.
cancelBubble Sets or retrieves whether the current event should bubble up the hierarchy of event handlers.
clientX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
clientY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
contentOverflow Retrieves a value that indicates whether the document contains additional content after processing the current LayoutRect object.
ctrlKey Sets or retrieves the state of the CTRL key.
ctrlLeft Sets or retrieves the state of the left CTRL key.
data New for Windows Internet Explorer 8  Sets or retrieves the body of the onmessage request.
dataFld Sets or retrieves the data column affected by the oncellchange event.
domain New for Internet Explorer 8  Sets or retrieves the fully qualified domain name of the document that fired the event.
fromElementfromElement Sets or retrieves the object from which activation or the mouse pointer is exiting during the event.
keyCode Sets or retrieves the Unicode key code associated with the key that caused the event.
MoreInfo Gets the MoreInfo content of an entry banner in an ASX file through the event object.
nextPage Retrieves the position of the next page within a print template.
offsetX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.
offsetY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.
propertyName Sets or retrieves the name of the property that changes on the object.
qualifier Sets or retrieves the name of the data member provided by a data source object.
reason Sets or retrieves the result of the data transfer for a data source object.
recordset Sets or retrieves from a data source object a reference to the default record set.
repeat Retrieves whether the onkeydown event is being repeated.
returnValue Sets or retrieves the return value from the event.
saveType Retrieves the clipboard type when oncontentsave fires.
scheme New for Internet Explorer 8  Sets or retrieves the HTTP protocol used by the document that fired the onmessage event.
screenX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.
screenY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.
shiftKey Sets or retrieves the state of the SHIFT key.
shiftLeft Retrieves the state of the left SHIFT key.
source New for Internet Explorer 8  Retrieves the source window object of the onmessage event.
srcElement Sets or retrieves the object that fired the event.
srcFilter Sets or retrieves the filter object that caused the onfilterchange event to fire.
srcUrn Retrieves the Uniform Resource Name (URN) of the behavior that fired the event.
toElement Sets or retrieves a reference to the object toward which the user is moving the mouse pointer.
type Sets or retrieves the event name from the event object.
userName Retrieves the sFriendlyName parameter that is passed to the useService method.
wheelDelta Retrieves the distance and direction the wheel button has rolled.
x Sets or retrieves the x-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.
y Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.
CollectionDescription
bookmarks Returns a collection of Microsoft ActiveX Data Objects (ADO) bookmarks tied to the rows affected by the current event.
boundElements Returns a collection of all elements on the page bound to a data set.
ObjectDescription
dataTransfer Provides access to predefined clipboard formats for use in drag-and-drop operations.

Remarks

The event object is available only during an event—that is, you can use it in event handlers but not in other code.

Although all event properties are available to all event objects, some properties might not have meaningful values during some events. For example, the fromElement and toElement properties are meaningful only when processing the onmouseover and onmouseout events.

In Microsoft Visual Basic Scripting Edition (VBScript), you must access the event object through the window object.

Several of the properties that apply to this object are not writable unless this object has been created using the createEventObject method. The following is a list of these properties: altKey, altLeft, button, clientX, clientY, ctrlKey, ctrlLeft, dataFld, offsetX, offsetY, propertyName, qualifier, reason, repeat, screenX, screenY, shiftKey, shiftLeft, srcUrn, type, x, and y.

Examples

This example uses the event object to check whether the user clicked the mouse within a link, and to prevent the link from being navigated if the SHIFT key is down.

<HTML>
<HEAD><TITLE>Cancels Links</TITLE>
<SCRIPT LANGUAGE="JScript">
function cancelLink() {
    if (window.event.srcElement.tagName == "A" && window.event.shiftKey) 
        window.event.returnValue = false;
}
</SCRIPT>
<BODY >

This example displays the current mouse position in the browser's status window.

<BODY >

Standards Information

This object is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 2 World Wide Web link.

Applies To

window
Tags What's this?: Add a tag
Community Content
 
Add Community Content
How can I pass javascript objects to client-side code?      Antaris   |   Edit   |  

Well, I know the mechanics of passing it, but it presents itself as a System.__ComObject.

If I am passing the event object, how could i access the properties of this object?

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG