I want my calllist.php page to refresh every 120 seconds and to have a countdown on the page until the page will refresh...
Any ideas on how i can do this??
Auto Refresh
Moderator: General Moderators
Re: Auto Refresh
I got the page to auto refresh using:
<tr><meta http-equiv="refresh" content="120;url=calllist.php"></tr>
no idea how to get a counter though (from 120 secs)...
Help plz
<tr><meta http-equiv="refresh" content="120;url=calllist.php"></tr>
no idea how to get a counter though (from 120 secs)...
Help plz
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Auto Refresh
Try to find a javascript counter, i'm sure it isnd hard to find one
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: Auto Refresh
Code: Select all
<span id="countdown_box">140</span>
<script type="text/javascript">
function decrementNumber(){
var t = document.getElementById('countdown_box');
var r = parseInt(t.innerHTML);
r = r - 1;
t.innerHTML = r;
}
x = setInterval(function (){ decrementNumber(); }, 1000);
</script>
Re: Auto Refresh
That code worked a treat...!
any idea how i can add the text: This page will auto-refresh in: [countdown] seconds
?
any idea how i can add the text: This page will auto-refresh in: [countdown] seconds
?
- Grizzzzzzzzzz
- Forum Contributor
- Posts: 125
- Joined: Wed Sep 02, 2009 8:51 am
Re: Auto Refresh
Code: Select all
This page will auto-refresh in: <span id="countdown_box">140</span> seconds
<script type="text/javascript">
function decrementNumber(){
var t = document.getElementById('countdown_box');
var r = parseInt(t.innerHTML);
r = r - 1;
t.innerHTML = r;
}
x = setInterval(function (){ decrementNumber(); }, 1000);
</script>