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
  • JSMethod handles the aliases of the controls
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
JSMethod (Function)
In french: JSMéthode
Used to run a JavaScript method on an element found in the current page.
This is an advanced function, requiring a good knowledge of Javascript.
Example
WEBDEV - Browser code
// Page element concerned: a Flash field 
// designated by its alias: "window.document." + sAlias
// JavaScript method: SetVariable
// Parameters: 
// - Customizable flash area: "_root.monScroll.TXT"
// - New text: sText
JSMethod("window.document." + sAlias, "SetVariable", ...
	"_root.myScroll.TXT", sText)
Syntax
JSMethod(<Full element name> , <Method> [, <Parameter 1> [... [, <Parameter N>]]])
<Full element name>: Character string
"JavaScript" name of element to use. In most cases, this name starts with "document.". You must use the aliases of controls. For more details, see Remarks.
<Method>: Character string
Method of the element to use. The method name must be indicated directly: it is not possible to use a constructed string.
<Parameter 1>: Optional character string
Parameters of the method.
<Parameter N>: Optional character string
Parameters of the method.
Remarks

JSMethod handles the aliases of the controls

Javascript is a case-sensitive language: the full name of the element must be case-sensitive: all page and field aliases are capitalized.
To build the name of element name, you must know the control alias. This alias corresponds to the control name in the HTML page. To find out this alias:
  • in the page editor, hover over the element to display the alias used in the tooltip for the field.
  • in the code editor, press Shift + F1.
  • use the Alias property.
When building the full element name, you have the ability to use "_PAGE_" to access the page.
Component: WDJS.DLL
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 01/16/2025

Send a report | Local help