Page 1 of 1
PHP code
Posted: Thu Nov 07, 2013 5:43 am
by vipinsaini
Hello.......
Actually i want to update a div of my webpage after a few seconds so can someone help me please??
Thanks in advance!!!
Re: PHP code
Posted: Thu Nov 07, 2013 5:48 am
by Celauran
PHP can't do that. Set a JavaScript timer to run on load and fire the change when the timer runs out.
Re: PHP code
Posted: Thu Nov 07, 2013 7:20 am
by vipinsaini
Celauran wrote:PHP can't do that. Set a JavaScript timer to run on load and fire the change when the timer runs out.
Can you please show it into code blocks please because i am not expert yet..
Re: PHP code
Posted: Thu Nov 07, 2013 10:42 pm
by Christopher
Please post the code you have tried.
Re: PHP code
Posted: Thu Nov 07, 2013 11:28 pm
by vipinsaini
Christopher wrote:Please post the code you have tried.
Actually I want to update after every few seconds this div...
Code: Select all
<div class="leftside">
<h3>Wall</h3>
<?php include ('homewall.php');?>
</div>
So in order to update this div i used this code.....
Code: Select all
<script src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script>
var auto_refresh = setInterval(
function()
{
$('#leftside').load('index.php');
}, 800);
$(document).ready(function(){
$('#leftside').load('homewall.php')
})
</script>
But unfortunately, this piece of code is not working.......... So i need help to fix this piece of code.
Please fix this code...
So is it the right code or do i have to change into this piece of code??? Moreover, how i will come to know that div is being updated??