HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 26th, 2012, 10:51 AM
cstringy cstringy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 cstringy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 25 sec
Reputation Power: 0
Page Auto Refresh

Hey,

I am working on a page with several webcam shots that I need to automatically refresh. Obviously this can be done with the meta tag or javascript however:

Some of the webcams shots load at different times, and some take up to a minute to come back. I would like the page to refresh every 10 seconds whether or not the page has "completely" loaded, is this possible?

Thanks in advance for any help.

Reply With Quote
  #2  
Old October 26th, 2012, 10:57 AM
Winters Winters is offline
Super Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jul 2003
Posts: 3,932 Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 12 h 55 m 12 sec
Reputation Power: 2632
Welcome to DevShed, cstringy!

Why do you imagine is it not possible? Have you run into issues? Which Javascript method have you tried?
__________________
[PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [ANSI C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

W3Fools - A W3Schools Intervention.

Reply With Quote
  #3  
Old October 26th, 2012, 11:02 AM
cstringy cstringy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 cstringy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 25 sec
Reputation Power: 0
Quote:
Originally Posted by Winters
Welcome to DevShed, cstringy!

Why do you imagine is it not possible? Have you run into issues? Which Javascript method have you tried?


Thanks for responding, right now I am using:

<script type="text/javascript">
window.onload = setupRefresh;

function setupRefresh() {
setTimeout("refreshPage();", 5000); // milliseconds
}
function refreshPage() {
window.location = location.href;
</script>

This is refreshing the page, but I am wondering if I can set like an actual timeout period (not dependent on the page fully loading)... The issue I am having is not being able to refresh the page every 10 seconds. If the page takes 30 seconds to load, I am stuck with a 40 second refresh. I guess this would be a JS question =\

Reply With Quote
  #4  
Old October 26th, 2012, 11:12 AM
Winters Winters is offline
Super Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jul 2003
Posts: 3,932 Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 12 h 55 m 12 sec
Reputation Power: 2632
Well, you are telling the script to run when the document finishes loading, so remove that and you should be good. The Javascript is in the HEAD tags?
Javascript Code:
Original - Javascript Code
  1. setTimeout("refreshPage();", 10000);
  2.  
  3. function refreshPage() {
  4.     window.location = location.href;
  5. }

Reply With Quote
  #5  
Old October 26th, 2012, 11:23 AM
cstringy cstringy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 cstringy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 25 sec
Reputation Power: 0
YOU ARE THE GREATEST!!!

Thank you so much, I am struggling to figure out how JS works so its hard to edit code I find... you just made my day.

Reply With Quote
  #6  
Old October 26th, 2012, 11:24 AM
Winters Winters is offline
Super Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jul 2003
Posts: 3,932 Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level)Winters User rank is General 25th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 12 h 55 m 12 sec
Reputation Power: 2632
Glad you got it working

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Page Auto Refresh

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap