Runs a server procedure without refreshing the page. This function is not locking. The other processes continue to run (no matter whether the result of the procedure run is retrieved or not).

As soon as the result of the server procedure is available, AJAXExecuteAsynchronous automatically calls a browser procedure used to retrieve this result.

To avoid locking the processes as long as the result of server procedure run is not retrieved, use AJAXExecute.

Note: The former browsers do not support the AJAX technology (Internet Explorer 5.5 and later, FireFox 1.0 and later, Netscape 7 and later, Opera 8 and later, Safari 1.2 and later, ...). AJAXAvailable is used to find out whether the AJAX technology is supported by the current browser. If a process that is using the AJAX technology is run on a browser that does not support this technology, the process is run "as if" it did not use the AJAX technology (the entire page is refreshed for example).

Example

// Is AJAX supported by the current browser?IF AJAXAvailable() = True THEN// Run the server procedure named "MyProc"// As soon as the result of the "MyProc" server procedure becomes available, // the "ProcResult" browser procedure will be runRes is intRes = AJAXExecuteAsynchronous(MyProc, ProcResult, CustomerName, Bonus)// The following processes are run without waiting for the result ...ELSE// Processes without using AJAX ...END

// -- Server procedure MyProc // --// Procedure used to find the data to modify in the pagePROCEDURE MyProc(CustomerName, RedRate)// Find the data to modify...// Returns the resultRESULT TheResult

// -- ProcResult browser procedure // --// Procedure automatically called as soon as the result of "MyProc" procedure becomes available// The "ModifiedData" parameter corresponds to the result of MyProc server procedurePROCEDURE ProcResult(ModifiedData, Res)// Analyze the result and update the modified controls...

<Result of server procedure> is a character string corresponding to the result returned by the <Server procedure>.

<Identifier of server procedure> is an integer corresponding to the identifier of the call to the <Server procedure> (<Result> parameter of AJAXExecuteAsynchronous).

<Parameter 1>: Optional character string (with quotes)

First parameter passed to <Server procedure>

<Parameter N>: Optional character string (with quotes)

Nth parameter passed to <Server procedure>.

Remarks

Result of server procedure

<Server procedure> is used to search for data to modify in the page. The result of this procedure (which means the data to modify) can be contained in a character string or in an XML document (created and handled by the XML functions.

To return this result to the browser, all you have to do is use the RESULT keyword and specify:

the character string containing the data.

the name of XML document containing the data.

<Browser procedure> is automatically run as soon as this result becomes available. The first parameter of <Browser procedure> contains this result. Then, this result must be managed to refresh the data to modify.

If this result corresponds to the name of an XML document, this document will be automatically transmitted and created on the browser. Then, this document can be handled by the XML functions.

Note: When using an XML document:

the XML document is not automatically deleted from the server when it is transmitted to the browser.

if an XML document with the same name is already found on the browser, the new XML document automatically replaces the former one.

Procedures that can be called by AJAX

To secure the WEBDEV sites, 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.

To allow a server procedure to be called by AJAX, click "AJAX" in the bar of procedure: