ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / HTML Editor functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
HTMLEditorExecuteJS (Function)
In french: EditeurHTMLExécuteJS
Executes JavaScript code in an HTML Editor control.
Example
// Récupère le nombre d'images dans le document en cours d'édition
HTMLEditorExecuteJS(EDHTML_MonEditeurHTML, "document.body.images.length", ...
			EditeurHTMLExécuteJS_Callback)
INTERNAL PROCEDURE EditeurHTMLExécuteJS_Callback(OK is boolean, LeRésultat is string)
	dbgAssert(OK)
	Info("Il y a " + LeRésultat + " images dans le document.") 
END
Syntax
HTMLEditorExecuteJS(<HTML Editor control> , <JavaScript code> [, <WLanguage procedure>])
<HTML Editor control>: Control name
Name of the HTML Editor control used.
<JavaScript code>: Character string
JavaScript code to execute.
<WLanguage procedure>: Optional procedure name
WLanguage procedure ("callback") used to find out the result of code execution. This procedure has the following format:
PROCEDURE <Procedure name>(bSuccess is boolean, ReturnValue is string)
This procedure is called once the JavaScript code has been executed. The parameters of this procedure are:
  • <bSuccess>:
    • True if the JavaScript code was successfully executed,
    • False if the execution of JavaScript code generated an error (e.g., error in the JavaScript code). In that case, to get more details on the error, use ErrorInfo.
      iPhone/iPad Note: The error returned is generic.
  • <ReturnValue> contains the value of the last expression of the JavaScript code (returned value).
Remarks
Javascript code is executed in the context of the document being edited: "document" represents the document being edited.
Component: wd300obj.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help