Hi, I searched on the Internet, but can't get it to work. I am trying to call the databaseUpdated.php file (placed in the same folder as the index.php file) from a function that is called every 10 seconds.
If I put the following in index.php
<script type='text/javascript'>updateboolean();</script>;
the function starts, so the problem is not that the php file is not being read.
databaseUpdated.php file
<body> <?php echo ("<script type='text/javascript'>updateboolean();</script>;"); ?> </body>
And here are my functions in javascript
$(document).ready(function(){ setInterval(function() { $.get("databaseUpdated.php");//Can't get this to work any obvious reason for this (And yes I have jquery working)? return false; }, 10000); }); function updateboolean(){ alert("Database updated"); document.location.reload(true); }
Thanks in advance =)
Edit
_________________________________________________________________________________________
When i do
alerts (data); in the function below i get the result when the image shows
$(document).ready(function(){ setInterval(function() { $.get('databaseUpdated.php', function(data) { alert('Load was performed.'); alert(data); eval(data); }); }, 5000); });

But eval (data) doesn't seem to work
source share