I have an Ajax function that sets a timestamp in my database at the touch of a button and returns the new timestamp, which appears in a text box.
Here's the issue: while the function works super-fast on a desktop browser, this function for mobile browsers. On a mobile browser, it takes 10 seconds or so (tested on my Eris Droid) to do the update and display the new timestamp. During that time, there is no indication that anything is going on.
I need some kind of indicator that something is happening - even if it's just a div that displays "Updating...".
I tried this:
if(readyState < 4)
div1.innerHTML = "Updating...";
if(readyState == 4)
div1.innerHTML = "";
...and it does nothing on my mobile (it flashes the div really fast on my desktop).
Does anyone know of a reliable way to display an update message on a mobile browser while the AJAX script is running?