On Interactive messaging during an ajax call

Discussion in 'Javascript' started by Chaprasi, Jun 2, 2006.

  1. Chaprasi

    Chaprasi Guest

    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
     
    Chaprasi, Jun 2, 2006
    #1
    1. Advertising

  2. Chaprasi

    Ian Collins Guest

    Chaprasi wrote:
    > 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'?

    --
    Ian Collins.
     
    Ian Collins, Jun 3, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. WJ
    Replies:
    2
    Views:
    525
  2. minnie
    Replies:
    1
    Views:
    735
    Andrew Thompson
    Dec 13, 2006
  3. traveller
    Replies:
    0
    Views:
    1,234
    traveller
    Jan 8, 2008
  4. ton
    Replies:
    2
    Views:
    2,190
  5. Cartoper
    Replies:
    2
    Views:
    397
    Henry
    Feb 18, 2008
Loading...

Share This Page