• I have a button that when clicked, performs two system calls using ajax. Is there a way to update a textbox with the current progress (i.e. “Task 1 finished. Task 2 pending”)?

    All I can figure out is to return when both tasks are finished.

    I was thinking I could do two $.post(ajaxurl, data, function (response){ calls inside my $( ).click(){ but it doesn’t work.

    I am using the sample plugin ajax-wordpress-boilerplate.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could break up the calls into two, make the first ajax call for task 1, on return response update the text “Task 1 finished. Task 2 pending”, then make another ajax call for the second task 2,on return response update the the text also “Both task finished”..

    Thread Starter deprekate

    (@deprekate)

    Oh, I just figured out it was working. They both executed at the same time (immediately), and then finished at the same time. I was doing a sleep and $().html(d.getTime()) to watch for two events. I was thinking I would see one ajax call finish, then sleep, then the next. But what I was seeing was the second one, since they finished at the same time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display progress of an ajax call’ is closed to new replies.