PRB: VBScript Style Event Trapping Does Not Work in JScriptID: Q183617
|
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 }
JScript 1.0 incorrectly implemented the above syntax.
Use the FOR and EVENT attributes of the <SCRIPT> tag to handle JScript events.
This behavior is by design.
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 <SCRIPT> tag:
<SCRIPT LANGUAGE="JScript" FOR="MyObject" EVENT="MyEvent(a, b)">
<!--
// event code
//-->
</SCRIPT>
For information on using JScript, refer to the documentation available at the following Web site:
http://msdn.microsoft.com/scripting/For more information, please see the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/default.asp
Additional query words:
Keywords : kbcode
Version : WINDOWS:2.0,3.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 7, 1999