Show Me The Script To Automatically Refresh A Webpage

A Member? Please Login  
type your username and password to login
Date: July 24, 2008, 10:06 PM
223350 members and 126753 Topics
Latest Member: talk2davoo
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Show Me The Script To Automatically Refresh A Webpage
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Show Me The Script To Automatically Refresh A Webpage  (Read 324 views)
bemas (m)
Show Me The Script To Automatically Refresh A Webpage
« on: June 20, 2006, 07:21 PM »

hello vbscripters,

can someone kindly tell me the script to automatically reload or refresh a web page  at given intervals with vb-script. without pressing the refresh button on the tool-bar or using F5 on the keyboard.

thanks

Ben
kazey (m)
Re: Show Me The Script To Automatically Refresh A Webpage
« #1 on: June 20, 2006, 07:28 PM »

You don't need a vbscript to do that.

A header meta tag would do. <meta http-equiv=refresh content="0; URL=http://">

change 0 to the seconds, and the url to what you want.
smartsoft (m)
Re: Show Me The Script To Automatically Refresh A Webpage
« #2 on: June 20, 2006, 10:22 PM »

Quote from: kazey on June 20, 2006, 07:28 PM
You don't need a vbscript to do that.

A header meta tag would do. <meta http-equiv=refresh content="0; URL=http://">

change 0 to the seconds, and the url to what you want.
bemas (m)
Re: Show Me The Script To Automatically Refresh A Webpage
« #3 on: June 21, 2006, 08:46 AM »

smart idea kazey,

it works fine. am very grateful.

kazey, What I actually want to achieve is to enable the user to set the refresh time.

if u don't mind, below is the full java code showing how i want it to look like. kindly assist.  Wink

<html>
<HEAD>

   <meta http-equiv=refresh content="5; URL=http://localhost/timer.html">

<title>service</title>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var up,down;var min1,sec1;var cmin1,csec1,cmin2,csec2;
function Minutes(data) {
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":")
break; 
return(data.substring(0,i));
}
function Seconds(data) {       
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":")
break; 
return(data.substring(i+1,data.length));
}
function Display(min,sec) {     
var disp;       
if(min<=9) disp=" 0";   
else disp=" "; 
disp+=min+":"; 
if(sec<=9) disp+="0"+sec;       
else disp+=sec;
return(disp);
}
function Up() {
cmin1=0;       
csec1=0;       
min1=0+Minutes(document.sw.beg1.value);
sec1=0+Seconds(document.sw.beg1.value);
UpRepeat();
}
function UpRepeat() {   
csec1++;       
if(csec1==60) {
csec1=0; cmin1++;
}
document.sw.disp1.value=Display(cmin1,csec1);   
if((cmin1==min1)&&(csec1==sec1))

{
NewWin=window.open('http://localhost/timer.html','NewWin',
'toolbar=no,status=no,width=600,height=300');
Up();
}

else up=setTimeout("UpRepeat()",1000);
}

// End -->
</SCRIPT>
</HEAD>

<Body>
<CENTER>
<FORM name="sw">
<TABLE border="0" width="100%">
<tr align="center">
<td><table border="3" width="100%"><tr>
<th colspan="2">Set Refresh-Me</th></tr>
<tr align="center">
<td>Stop at<br>
<input type="text" name="beg1" size="7" value="0:20"></td>
<td><input type="button" value="Start" onclick="Up()"></td>
</tr>

<tr align="center"><td colspan="2">
<input type="text" name="disp1" size="7"></td></tr></table></td>


</tr>
</TABLE>
</FORM>
</CENTER>

</Body>
 Whats The Difference B/w Mysql And Sql: Do They Relate?  Guys Abeg  Help! Uploading Pictures  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Jobs (2) Career Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.