Okay I was able to make it recognize changes using sessions.
queries page:
Code:
session_start();
//job log entries
$total_job_log_entries = '0';
$total_job_log_entries = ceil(mysql_num_rows(mysql_query("SELECT id FROM job_log WHERE id > '1'")));
if ($total_job_log_entries != $jle_old){
echo "Total number of job log entries: " . $total_job_log_entries . "<br>";
}else{
echo 'noupdate';
}
$HTTP_SESSION_VARS["jle_old"] = $total_job_log_entries;
mysql_close();
ajax page:
Code:
function handleJoblog() {
if(httpjob.readyState == 4) {
var response = httpjob.responseText;
if(response != 'noupdate') {
document.getElementById('bar').innerHTML = response;
document.getElementById('bar').style.color = "black"
}
}
}
Now the only problem is I don't want the page to actually echo "noupdate". Basically I want this:
if(response = 'noupdate') {
then echo old number and leave color alone
}
if(response != 'noupdate') {
echos new number and the background fades from one color to another
}