ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Web-specific functions / AJAX functions
  • Overview
  • AJAX functions
  • Procedures that can be called by AJAX
  • WLanguage functions useless in AJAX
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
The diagram below presents the use of "programmed AJAX" in a WEBDEV website:
Execution of a process on the browser side (AJAXExecute or AJAXExecuteAsynchronous).
Request to execute a procedure on the server side.
The procedure is executed on the server.
Generation of the result. The result of the procedure will be expressed as a character string or an XML document.
The result of the procedure is sent (RESULT).
Analysis of the procedure result.
Refresh modified data. Only the necessary controls are refreshed.
AJAXExecute allows you to call a server procedure from browser code. No other process is run until the result of the server procedure is received.
When this function is used, no values from the control are sent to the server. With this function, the browser requests the server to execute a procedure and return a result. The result can be in JSON or XML format, or be a series of "simple" variables (int, string, boolean, real).
AJAXExecuteAsynchronous executes a server procedure without refreshing the page. This function does not block the application. The other processes continue to run, whether or not the result of the procedure is received.
Once the result of the server procedure is available, AJAXExecuteAsynchronous automatically calls a browser procedure to retrieve the result.
AJAX functions
For more complex processes, WEBDEV offers several AJAX functions (listed here in order of interest):
AJAXAvailableUsed to find out whether the AJAX technology is supported by the current browser.
AJAXExecuteExecutes a server procedure without refreshing the page. This function blocks the application. No other process is run until the result of the server procedure is received.
AJAXExecuteAsynchronousExecutes a server procedure without refreshing the page. This function does not block the application. The other processes continue to run (no matter whether the result of the procedure run is retrieved or not).
AJAXAsynchronousCallPendingDetermines if a server procedure called by AJAXExecuteAsynchronous is being executed.
AJAXCancelAsynchronousCallCancels the automatic execution of the browser procedure called by AJAXExecuteAsynchronous.

These functions allow you to run a server procedure from a browser process.
Note: It is necessary to ensure consistency between the data stored on the server and the data shown to the end user. For example, if data is modified, this data must be modified both on the server and on the page displayed in the browser.
Procedures that can be called by AJAX
To secure the WEBDEV websites, the server procedures are protected from illegal calls (attempt to re-route a session for example). To run a server procedure from a browser process (AJAXExecute or AJAXExecuteAsynchronous), you must allow this procedure to be called by AJAX.
By default, new server procedures are set to "automatic" mode.
Automatic mode detects if there are any calls to the server procedure written in browser code. This includes any use of the AJAXExecute function or any direct calls. The number of detected calls appears in the procedure header.
Two other modes can be enabled via the context menu of the procedure header:
  • "Always accessible from browser code" (accessible).
  • "Never accessible from browser code" (inaccessible).
You can force accessible mode to handle cases where calls are not automatically detected. This happens when procedures are located in external components and calls are made from the project.
You can also force inaccessible mode. In this case, the procedure can never be called from a browser code.
Note: Procedures accessible from browser code can be executed with malicious intent. "Inaccessible" mode provides additional security compared to automatic mode. "Automatic" mode makes the procedure inaccessible from a browser only if it has never been called from browser code.
WLanguage functions useless in AJAX
All the functions available in WEBDEV server can be used in AJAX. However, the folllowing functions are useless in AJAX. Therefore, these functions are not available in AJAX.
ContextCloseCloses a page session
ContextOpenOpens a new page context without returning the information to the browser.
FileDisplayDisplays a file in the user's browser.
FramesetDisplayDisplays a WEBDEV frameset in the user's browser.
FramesetRefreshRefreshes a frameset displayed in the user's browser from the context on the server.
FramesetUseDisplays a WEBDEV frameset in the browser of the Web user and closes all the current page and frameset contexts.
InitWindowResets (or not) the controls found in the current page and runs the initialization processes of controls.
PageInitializationResets (or not) the controls found in the current page and runs the initialization processes of controls.
PageUseDisplays a WEBDEV page in the browser of the Web user and closes all the current page contexts.
ScriptDisplayCalls an external script (.php, .asp, .mhtml or .mht) and returns the result page in the current browser window.
StringDisplayDisplays a character string (or a buffer) in the browser.
UploadCopyFileSaves on the server a file "uploaded" by the Web user.
UploadFileNameReturns the name of a file "uploaded" by the Web user.
UseDisplays a page in the browser of Web user.

This list can evolve. It is recommended to check the documentation for each function. The logo indicates whether the function is available in AJAX.
Minimum version required
  • Version 10
Comments
Click [Add] to post a comment

Last update: 07/24/2025

Send a report | Local help