I guess it is working, just not doing what I was wanting it to do. :-(

As mentioned, I have a link on the main screen that opens a 'stats' screen via 
AJAX, <a href='stats.php'>. 
This PHP script returns a div, <div id='Stats' ...>, that contains data from a 
mySQL database. 
If I understand correctly, the AJAX call places the output of stats.php into 
the main document, index.php, therefore the window.location.reload(true) 
statement does not access the the stats.php file. Although, if it were to 
reload index.php from the server, it would not yet have the 'Stats' div yet and 
no way of knowing where to look for it, so where does it reload the 'Stats' div 
from???

My solution is to use the following function to perform the refresh:

function refreshStats() {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.open("GET","stats.php",false);
        xmlhttp.send();
        document.getElementById('Stats').innerHTML=xmlhttp.responseText;
        }

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to