Show Me The Script To Automatically Refresh A Webpage

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 24, 2009, 09:04 PM
432081 members and 299049 Topics
Latest Member: Omoluabi10
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 543 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 dont 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>
kheme (m)
Re: Show Me The Script To Automatically Refresh A Webpage
« #4 on: August 08, 2008, 08:01 PM »

i'd modify the code and re-post it, don't worry!
kheme (m)
Re: Show Me The Script To Automatically Refresh A Webpage
« #5 on: August 15, 2008, 10:07 AM »

remove this line from the page

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

and the script should work. try it!
 My Programming Skills (J. C. Ozochi)  Oracle Training  Windows 2003 Multiple Installations With One Cd?  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

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

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.