Hello.......
Actually i want to update a div of my webpage after a few seconds so can someone help me please??
Thanks in advance!!!
PHP code
Moderator: General Moderators
Re: PHP code
PHP can't do that. Set a JavaScript timer to run on load and fire the change when the timer runs out.
-
vipinsaini
- Forum Newbie
- Posts: 5
- Joined: Thu Nov 07, 2013 5:33 am
Re: PHP code
Can you please show it into code blocks please because i am not expert yet..Celauran wrote:PHP can't do that. Set a JavaScript timer to run on load and fire the change when the timer runs out.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
-
vipinsaini
- Forum Newbie
- Posts: 5
- Joined: Thu Nov 07, 2013 5:33 am
Re: PHP code
Actually I want to update after every few seconds this div...Christopher wrote:Please post the code you have tried.
Code: Select all
<div class="leftside">
<h3>Wall</h3>
<?php include ('homewall.php');?>
</div>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>
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??