Ok I got the timer working but have one last question following.
In the test.php page is this.
PHP Code:
<?php
if ($_GET['act'] == "countPosts") {
$getfile = date("s");
$imagefile = "file" . $getfile . ".jpg";
echo "<img src='/$imagefile'>";
?>
How do I get this javascript function
Code:
function handleResponse() {
if(http.readyState == 4 && http.status == 200){
// Text returned FROM PHP script
var response = http.responseText;
if(response) {
// UPDATE ajaxTest content
document.getElementById("countPosts").innerHTML = response;
setTimeout('countPosts()',2000);
}
To show an image as well as text? Right now its pulling the correct image from the php but its not showing it as an image.
Please let me know how to change the javascript function, to include images in the response as well as text, thank you.
Bookmarks