Don't really know AJAX that well.. Here is the issue.
I am reading a database within the PHP function that populate some global variables, I can access the variables ok, but I need the php function to be called regularly.
<?php
function thatIwant()
{
//read database
return 10;
}
echo("
<script>
function refreshDiv()
{
//// this is where I need to call the above function.
var refresher = setTimeout('refreshDiv()', 2000);
}
</script>
");
?>