ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Web-specific functions / Miscellaneous WEBDEV functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
JSInfoEvent (Function)
In french: JSInfoEvénement
Allows you to handle the JavaScript properties of the browser event that triggered the code execution. For example:
  • read a JavaScript property of the event.
  • assign a value to a JavaScript property of the event.
This is an advanced function, requiring a good knowledge of JavaScript.
Example
// Lecture de la position de la souris lors du clic
nPosX is int = JSInfoEvent("clientX")
Syntax

Retrieving the value of an event property Hide the details

<Result> = JSInfoEvent([<Property>])
<Result>: Variant
Property value.
<Property>: Optional character string
Property to use. If this parameter is not specified, JSInfoEvent retrieves the object directly. JSInfoEvent can be used as an argument of a browser procedure written in JavaScript.

Modifying a property of the event Hide the details

JSInfoEvent(<Property>)
<Property>: Character string
Property to use.
Remarks
  • The "event" objects differ according to the browsers. Some properties are not available for all browsers.
  • The event that triggered the execution of the code may not be available. Before using this event, we recommend that you check its existence with the following line of code for example:
    IF JSInfoEvent() THEN ...
  • In WEBDEV processes entered directly in Javascript, the function JSInfoEvent function must not be used: the Event object.
  • The JSInfoEvent function is only available in a browser code event, called directly. JSInfoEvent is not available:
    • in browser procedures.
    • in browser events called directly or indirectly from a browser procedure (via the ExecuteProcess function, for example).
Component: WDJS.DLL
Minimum version required
  • Version 11
Comments
Capture carriage return key code
keyCode is int = JSInfoEvent("keyCode")

// 13 es equivalente al retorno de carro en codigo ASCII
IF keyCode = 13 THEN
// If enter key was pressed execute this
END
Alejandro
19 Apr. 2024

Last update: 03/27/2025

Send a report | Local help