Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,110 members, 7,814,894 topics. Date: Wednesday, 01 May 2024 at 10:22 PM

Show Me The Script To Automatically Refresh A Webpage - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Show Me The Script To Automatically Refresh A Webpage (3441 Views)

Home Page Logout On Page Refresh / PHP Script To Send Simple Messages / How Do I A dd Free Sms Script To My Site (2) (3) (4)

(1) (Reply) (Go Down)

Show Me The Script To Automatically Refresh A Webpage by bemas(m): 7:21pm On Jun 20, 2006
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
Re: Show Me The Script To Automatically Refresh A Webpage by kazey(m): 7:28pm On Jun 20, 2006
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.
Re: Show Me The Script To Automatically Refresh A Webpage by smartsoft(m): 10:22pm On Jun 20, 2006
kazey:

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.
Re: Show Me The Script To Automatically Refresh A Webpage by bemas(m): 8:46am On Jun 21, 2006
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)==":"wink
break;
return(data.substring(0,i));
}
function Seconds(data) {
for(var i=0;i<data.length;i++)
if(data.substring(i,i+1)==":"wink
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>
Re: Show Me The Script To Automatically Refresh A Webpage by kheme(m): 8:01pm On Aug 08, 2008
i'd modify the code and re-post it, don't worry!
Re: Show Me The Script To Automatically Refresh A Webpage by kheme(m): 10:07am On Aug 15, 2008
remove this line from the page

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

and the script should work. try it!

(1) (Reply)

Java World: Questions And Solutions (java Only Pls) / My Blog Pictures Will No Longer Show On Facebook. / Golang Developers' Whatsapp Group

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.