www.webdeveloper.com
Results 1 to 9 of 9

Thread: progress bar animation (processing.gif) in sync and async mode

  1. #1
    Join Date
    Nov 2005
    Location
    chennai, tamil nadu, india
    Posts
    77

    progress bar animation (processing.gif) in sync and async mode

    Hi,

    I use both sync and async modes.
    Before starting any ajax request i display a processing(rotating) gif icon to show that the request is in progress.
    when i get the response i will hide the animating gif to show that the process has completed.
    this works fine with async and sync mode of ajax in FF but not in IE.

    If i use sync mode. that is AJAX.open('GET','path.php',false); in IE the gif file is not visible
    because IE is not displaying it. Basically this is also correct because that is the way sync is meant to.
    If it is sync mode then no other process will take place until the browser gets the response.
    Were as in async mode the request is threaded so other processes are not affected.

    But FF displays the animated gif for both the modes of ajax. and IE displays the animated gif only for async request.
    If anybody know the reason behind then please post your replies. 'cause i have simplified most of my projects by using sync mode of ajax.
    But in IE the progress (processing) animation is not visible so the user will not know what is happening till the browser gets the response.

    So, i hope that i have to stick with async mode. in sync mode you can write code in a few lines and it is very easy to have various type of functions which could return bool, array, object etc... since you get the result in the LHS... but that is not the case in async mode... we need to do a lot of gimmick to have a prototype of ajax...

    also if i could have references to sites which explains ajax in complete detail then i will update my idea of ajax.

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    Why don't you show the loading animation before opening the connection with AJAX? It seems to me that would fix the issue.

  3. #3
    Join Date
    Nov 2005
    Location
    chennai, tamil nadu, india
    Posts
    77

    yes

    The gif is already being animated. it is just hidden. before creating ajax instance i an change the style to visible.

  4. #4
    Join Date
    Dec 2009
    Posts
    2

    I have same problem.. T-T

    I have same problem above it. But, you may misunderstand the situation.

    In Sync-mode Ajax calling at IE,

    ProgressBar (animated gif) wad displayed absolutely But we did not see

    because of IE's stupid response time.

    Just before you calling Ajax, try this code.

    alert("progress");

    and you can see the progress bar below alert window.

    While calling Ajax with Sync-mode, Only IE act like stopped so any object did not be displyed properly.

    if you calling some enough long-timed command, you can see what happend exactly.

    I'm seriouly worried about this problem and have not found any good solution about it.

    Open popup as panel progress bar was animated. it works fine. but I'm not satisfied at all.

  5. #5
    Join Date
    Jan 2009
    Posts
    3,346
    Why are you using sync versus async? Is there a good reason why you can't use the method that works every time instead of the buggy one? Maybe there is something missing in the code. Can you post the relevant sections and/or a live link?

  6. #6
    Join Date
    Dec 2009
    Posts
    2

    The reason why I'm using SYNC-mode is..

    the reason why I'm using sync-mode is limitation of client-calling.

    In Async mode, clinet can call request twice at once, so...

    It makes server very busy. I want to hide this situation .

  7. #7
    Join Date
    Nov 2005
    Location
    chennai, tamil nadu, india
    Posts
    77

  8. #8
    Join Date
    Jan 2009
    Posts
    3,346
    Quote Originally Posted by nayasis View Post
    the reason why I'm using sync-mode is limitation of client-calling.

    In Async mode, clinet can call request twice at once, so...

    It makes server very busy. I want to hide this situation .
    I would suggest implementing a limit of the number of outgoing calls in your code. SYNC mode only prevent your code from being responsive while waiting on a response from the server. I would check for existing connections and create a queue if you are that worried about server load.

  9. #9
    Join Date
    Nov 2005
    Location
    chennai, tamil nadu, india
    Posts
    77

    here is the answer for a previous criterion9 question

    Why are you using sync versus async? Is there a good reason why you can't use the method that works every time instead of the buggy one? Maybe there is something missing in the code. Can you post the relevant sections and/or a live link?
    i had functions which would work like the following

    Code:
    if(ajaxRequestBool('ajax.php','action=getstatus"))
    alert("registered");
    else alert(not registered);
    i have wrapped ajax request in such functions and i have many like that.

    all those are by using sync mode...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles