PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Automatic and immediate AJAX
  • Programmed AJAX
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
7. AJAX technology
Previous pageTable of contentsNext page
The AJAX technology is available natively in WEBDEV.
What is AJAX and what are its advantages?
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 shorted.
  • the user sees information immediately and without undesired visual effects.
AJAX can be used at two different levels in a WEBDEV site:
  • Automatic and immediate AJAX: a simple click allows you to access the AJAX features. The code remains the same.
  • Programmed AJAX: functions for AJAX management allow you to write complex processes.
Remark: Only sufficiently recent browsers support AJAX technology. 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 and immediate AJAX
The diagram below presents the automatic and immediate use of AJAX in a WEBDEV site:
For example, a site page is used to find out the different characteristics of a country (capital city, currency, flag, location, etc.). The corresponding information is displayed according to the country selected by the user.
1Internet user's action. In our example, the Web user selects the country in the "Select a country" combo box.
2The request is sent to the server.
3The request is executed: the characteristics of the selected country are searched for.
4The result of the request is sent:
  • without AJAX: the entire page is returned.
  • with AJAX: the characteristics of the selected country are returned.
5The characteristics of the country are displayed:
  • without AJAX: the entire page is redisplayed.
  • with AJAX: the controls containing the country characteristics are refreshed.
Programmed AJAX
The diagram below presents the use of "programmed AJAX" in a WEBDEV site:
1Execution of a browser process (AJAXExecute or AJAXExecuteAsynchronous).
2Request to execute a server procedure.
3The server procedure is executed.
4The result is generated. The result of the procedure will be expressed as a character string or an XML document.
5The result of the procedure is sent (RESULT).
6The result of the procedure is analyzed.
7The modified information is displayed. Only the necessary controls are refreshed.
Previous pageTable of contentsNext page
Comments
Click [Add] to post a comment