3.2.0

On Page AJAX request status indicator

This seems to work so I thought I'd make a small contribution by sharing.

During XMLHttp [AJAX] requests this snippet of over-rides updates a text box (named 'status' in form called 'test') with the status of the network activity/ data load. If I could find an appropriate graphical icon it would probably be sleeker to have an "activity" icon appear and disappear during network access but you can plugin whatever you want.

var table = new Active.XML.Table;

var defaultRequest=table.request;
table.request=function(data){
document.forms.test.status.value='Loading...';
defaultRequest.call(table,data);
}


var defaultResponse= table.response;
table.response=function(data){
document.forms.test.status.value='Ready';
defaultResponse.call(table,data);
}


If there is an obvious easier way to achieve this I'd be curious to know. In my experience the 'Loading Data, please wait..' indicator does not appear on subsequent AJAX requests but there is a definite need for a visual queue that the request is being processed.





Jared
November 20,

This topic is archived.

See also:


Back to support forum