Hey yall,
I've integrated some AJAX into my website and it's working profoundly. One problem, however.
(be advised, my site is not yet published publically so i will only describe)
Say I have a link to update a wishlist...
"Add item to wishlist"
Then the user clicks on it and it calls a PHP script, executes, and when it's done it says
"Item added to wishlist"
OR
"Item already in wishlist"
But the time between the click and the printing of the result is the problem... It takes a second or two for it to appear. How can I implement a "loading bar" image to replace that timelapse.
Now I've googled the crap out of this, but mostly what I find is AJAX pertaining to ASP. I seen a lot about UpdatePanel, but nothing pertaining to PHP.
Any help here? Snippets are welcomed as I can learn from those as well and modify; however, if a tutorial link is provided that would be just as appreciated.
Help with AJAX updatepanel
Moderator: General Moderators
Re: Help with AJAX updatepanel
Within your ajax function you no doubt have something testing the ready state - if it's 4 its completed. Well you can easily make stuff happen when its not 4 aswell.
I normally have a hidden div with a loadingin animation inside it. When the readystate is not 4, show the div, otherwise hide it.
I normally have a hidden div with a loadingin animation inside it. When the readystate is not 4, show the div, otherwise hide it.