Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,861 members, 7,956,246 topics. Date: Monday, 23 September 2024 at 08:33 AM |
Nairaland Forum / Science/Technology / Programming / Show Me The Script To Automatically Refresh A Webpage (3480 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)
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: |
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. <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> |
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)
85% Intelligent Ai For Football Betting / How Do I Protect My Wordpress Plugin From Being Pirated / Lambda School X Paystack Bootcamp
(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. 15 |