59
rated 0 times
[
62]
[
3]
/ answers: 1 / hits: 25790
/ 11 Years ago, fri, may 3, 2013, 12:00:00
Hi I have searched the web but can't get this to work. I'm trying to call the file databaseUpdated.php (placed in the same folder as the index.php file) from a function that is called every 10 seconds.
If I place the following in the index.php
<script type='text/javascript'>updateboolean();</script>;
the function is runned so thats not the problem, the problem is that the php file is not read.
the file databaseUpdated.php
<body>
<?php
echo (<script type='text/javascript'>updateboolean();</script>;);
?>
</body>
And here is my functions in the 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
alert(data); in the below function I get the result as the image will show
$(document).ready(function(){
setInterval(function() {
$.get('databaseUpdated.php', function(data) {
alert('Load was performed.');
alert(data);
eval(data);
});
}, 5000);
});
But the eval(data)
doesn't seem to work
More From » php