ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WEBDEV concepts / Part 1 - Internet: Main concepts
  • Automatic AJAX
  • Programmed AJAX
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
7. AJAX technology
Previous pageTable of contentsNext page
The AJAX technology is available natively in WEBDEV.
What does AJAX mean and what are its benefits?
AJAX (Asynchronous JavaScript and XML) is used to refresh the data modified in an HTML page without having to redisplay the entire page. For example, if some elements in the page displayed (content of the cart, characteristics of a product, list of cities, map, etc.) are modified, only these elements will be refreshed. The server will not have to send the entire page to the user's computer.
This technology has several advantages:
  • fewer requests are made to the server. Therefore, it can support a larger number of simultaneous connections.
  • the information that circulates is less bulky.
  • the transmission time is shorter.
  • the user sees information immediately and without undesired visual effects.
AJAX can be used at two different levels in a WEBDEV website:
  • Automatic and immediate AJAX: A simple click allows you to benefit from AJAX features. The code remains the same.
  • Programmed AJAX: You can use AJAX functions to perform complex processes.
Note: Some older browsers do not support AJAX. AJAXAvailable is used to determine if the current browser supports AJAX technology. If a process that uses AJAX is run on a browser that does not support this technology, the process is run "as if" it did not use AJAX (e.g., the entire page is refreshed).
Automatic AJAX
The following diagram shows the automatic and immediate use of AJAX in a WEBDEV site:
For example, a Web page contains the different characteristics of a country (capital, currency, flag, location, etc.). Depending on the country selected by the user, the relevant information is displayed.
Internet user's action. In our example, the Web user selects the country in the "Select a country" combo box.
The request is sent to the server.
The query is executed and the search for the characteristics of the chosen country starts.
The result of the request is sent:
  • without AJAX: The entire page is sent.
  • with AJAX: Only the characteristics of the country are sent.
The characteristics of the country are displayed:
  • without AJAX: The entire page is redisplayed.
  • with AJAX: Only the controls containing the characteristics of the country are refreshed.
Programmed AJAX
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.
Execute server procedure.
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.
The AJAXExecute function is used to call a server procedure from a browser code. As long as the result of the executed procedure has not been retrieved, no further processing is performed.
When this function is used, no field values have been sent to the server. This function allows the browser to execute a procedure on the server and return a result. This result can be in JSON or XML format, or correspond to "simple" variables (integer, string, Boolean, real).
The AJAXExecuteAsynchronous function executes a server procedure without refreshing the page. This function is not locking. Other processes continue to run normally (whether or not the result of the procedure is recovered).
As soon as the result of the server procedure is available, the AJAXExecuteAsynchronous function automatically calls a browser procedure to retrieve the result.
Previous pageTable of contentsNext page
Comments
Click [Add] to post a comment

Last update: 06/30/2025

Send a report | Local help