Microsoft KB Archive/183617

= PRB: VBScript Style Event Trapping Does Not Work in JScript =

Article ID: 183617

Article Last Modified on 8/8/2007

-

APPLIES TO


 * Microsoft JScript 2.0
 * Microsoft JScript 3.0

-



This article was previously published under Q183617



SYMPTOMS
In Microsoft JScript 1.0, the VBScript-style event syntax using Object_Event could be used to trap events. The following is an example of this syntax: function MyObject_MyEvent(a, b) { // event code }



CAUSE
JScript 1.0 incorrectly implemented the above syntax.



RESOLUTION
Use the FOR and EVENT attributes of the  tag to handle JScript events.



STATUS
This behavior is by design.



MORE INFORMATION
The Object_Event syntax worked in JScript 1.0, but this incorrect syntax was removed in JScript 2.0.

Here is the correct syntax to trap events in JScript, using the FOR and EVENT attributes of the  tag:  

