Description

There are three special functions that you can define to hook into Anthem's call back process: Anthem_PreCallBack, Anthem_PostCallBack, and Anthem_CallBackCancelled.

Example

Click the following button to get the current time:

?

You should be prompted to make sure you really want to get the current time. If you say OK, you should see a red "Loading..." message in the upper right corner of your page (similar to what Gmail does). I put a call to Thread.Sleep in the call back method to make sure you see it. When the call back completes the "Loading..." message should go away.

If you click Cancel when prompted, you won't see that message but you will see an alert telling you that you cancelled the call back.

Remarks

Before a call back is made to the server, a function called Anthem_PreCallBack on the client page is invoked if it exists. If it returns false, the call back is cancelled.

If the call back is cancelled, a function called Anthem_CallBackCancelled is invoked if it exists.

If the call back was not cancelled, a function called Anthem_PostCallBack is invoked if it exists.

View source to see how these three JavaScript functions are implemented on this page.