Jump to content

Ajax Progress


-Karl-

Recommended Posts

So, I have a script in PHP which will grab usernames from a database, then, it will carry out a function for each of the usernames. Grab the data, then store it in a database.

 

I'm a complete noob with Ajax. But how could I utilize Ajax to show the progress. Such as if the database has 18 rows, it will display "1 out of 18", then "2 out of 18", and so on.

Link to comment
Share on other sites

  • 4 weeks later...

you could, first to you connect get all the rows, store that.start a different variable at 0, then each user you process just ++ that and then edit a div

<div id="hi"></div>

t= amount fo users

x= 0

function{

x++

do your user stuff what ever

 

document.getelementById('hi').innerHTML = x."/".t

}

 

If that makes sence ? I would make sure the spellings right if you copy and paste that ^]

hope it helps !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.