|
| |
|
|
nay27uk
Posts: 282 Joined: 5/13/2003 From: leicester uk Status: offline
|
AUTO REFRESH - 5/13/2003 9:47:16
Could someone tell me how i get a page to auto refresh. (Example) I have made a guest book using frontpage access2002 database and asp pages. now when you fill the form out and return to see your input you have to manualy refresh the page to display the new input. I want to have it auto refresh like this site does when you reply or start a new thread
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: AUTO REFRESH - 5/13/2003 10:28:48
a nice little javascript code would do it. If you want a button would could use somthing like: <' a href=" javascript:location.reload()" target=" _self" >Refresh</a> or automatically: <script type=text/javascript>
// The time out value is set to be 10,000 milli-seconds (or 10 seconds)
setTimeout(' document.location=document.location' ,10000);
</script>
< Message edited by micah -- 5/13/2003 10:31 AM >
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
nay27uk
Posts: 282 Joined: 5/13/2003 From: leicester uk Status: offline
|
RE: AUTO REFRESH - 5/13/2003 11:03:41
Sorry if i seem dumb but i dont know what you meen by ===================================================== a nice little javascript code would do it. If you want a button would could use somthing like: <' a href=" javascript:location.reload()" target=" _self" >Refresh</a> What do i do with this code i tryed it on a blank page but ther was no button ===================================================== also how do this part work againe i tryed it on blank page with a picture but it never refreshed or automatically: <script type=text/javascript> // The time out value is set to be 10,000 milli-seconds (or 10 seconds) setTimeout(' document.location=document.location' ,10000); </script> ===================================================== i found this script but its not what i want it refreshes every so many seconds or minuits <script> <!-- /* Auto Refresh Page with Time script By JavaScript Kit (javascriptkit.com) Over 200+ free scripts here! */ //enter refresh time in " minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59 var limit=" 0:60" if (document.images){ var parselimit=limit.split(" :" ) parselimit=parselimit[0]*60+parselimit[1]*1 } function beginrefresh(){ if (!document.images) return if (parselimit==1) window.location.reload() else{ parselimit-=1 curmin=Math.floor(parselimit/60) cursec=parselimit%60 if (curmin!=0) curtime=curmin+" minutes and " +cursec+" seconds left until page refresh!" else curtime=cursec+" seconds left until page refresh!" window.status=curtime setTimeout(" beginrefresh()" ,1000) } } window.onload=beginrefresh //--> </script> =====================================================
_____________________________
REGARDS NATHAN
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: AUTO REFRESH - 5/13/2003 11:09:24
ok - forget the javascript - here' s an easier way: in between the <head> </head> tags on your page that you want to refresh <meta http-equiv=" pragma" content=" no-cache" > it won' t refresh but it will stop the cache from working.
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: AUTO REFRESH - 5/13/2003 11:13:59
or you could try: <% Response.CacheControl = " no-cache" %>
<% Response.AddHeader " Pragma" , " no-cache" %>
<% Response.Expires = -1 %>
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
etfc1881
Posts: 1 Joined: 11/20/2007 Status: offline
|
RE: AUTO REFRESH - 11/20/2007 11:00:38
That does work, but while we have used that we have come across a problem. On the page that we have got the auto refresh on, we also have a music player as well, this means that when the page refreshes so does the music player. Is there anyway that we can exclude the music player from being refreshed when the page does, is there a code for this at all??? Thanks in advance Andy
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|