PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
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
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 the details of 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: wd270obj.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment