On Interactive messaging during an ajax call

C

Chaprasi

Hi,

I was wondering how I can achieve to display a 'Please wait loading...'
message only if the ajax call is taking more than a second.

The message should only appear if the Ajax call is taking more time
than a second. In my example I set my ajax timeout for 10 seconds and
at my server I sleep for 5 seconds.

So in my example

I get the onloading state and then the server sleeps for 5 seconds and
then finally I get the interactive and on success. So How can I get a
handle in onInteractive that the call is still taking time.

AjaxRequest.get (
{
'url': someURL,
'timeout': 10000,
'parameters': someParams,
'onLoading': 'record current time',
'onInteractive': 'check time if its more than a second',
'onSuccess': 'some success message',
'onTimeout': 'some timeout message',
'onError': 'some error message'
}
);

Thank you
Chaprasi
 
I

Ian Collins

Chaprasi said:
Hi,

I was wondering how I can achieve to display a 'Please wait loading...'
message only if the ajax call is taking more than a second.

The message should only appear if the Ajax call is taking more time
than a second. In my example I set my ajax timeout for 10 seconds and
at my server I sleep for 5 seconds.

So in my example

I get the onloading state and then the server sleeps for 5 seconds and
then finally I get the interactive and on success. So How can I get a
handle in onInteractive that the call is still taking time.

AjaxRequest.get (

What's an 'AjaxRequest'?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top