ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / HTML Editor functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
HTMLEditorExecuteJS (Function)
In french: EditeurHTMLExécuteJS
Executes JavaScript code in an HTML Editor control.
Example
// Get the number of images in the document being edited
HTMLEditorExecuteJS(HTMEDT_MyHTMLEditor, "document.body.images.length", ...
HTMLEditorExecuteJS_Callback)
INTERNAL PROCEDURE HTMLEditorExecuteJS_Callback(OK is boolean, TheResult is string)
dbgAssert(OK)
Info("There are " + TheResult + " images in the 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 Remark: A generic error is returned.
  • <ReturnValue> contains the value of the last expression of the JavaScript code (returned value).
Remarks
The JavaScript code is executed in the context of the document being edited: "document" represents the edited document.
Component: wd290obj.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help