jquery repeat process once get reply from php file

Posted by air on Stack Overflow See other posts from Stack Overflow or by air
Published on 2010-03-23T12:00:09Z Indexed on 2010/03/23 12:03 UTC
Read the original article Hit count: 419

Filed under:
|
|

i have one php file which process adding of record in Database fro array.

for example in array i have 5 items

        aray an='abc','xyz','ert','wer','oiu'

i want to call one php file in j query ajax method

   um = an.split(',');
    var counter = 0;
   if(counter < uemail.length) {
   $("#sending_count").html("Processing Record "+ ecounter +" of " + an.length);
   var data = {uid: um[counter]
   $.ajax({
   type: "POST",
  url: "save.php",
  data: data,
   success: function(html){
   echo "added";
   counter++; 
   }

what it do, it complete all the prcess but save.php is still working what i want after one process it stop untill process of save.php complete then it wait for next 10 sec and start adding of 2nd element.

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about AJAX