HTML - No-activity Refresh Code
Okay, so heres my problem,
i am creating a page for a touch screen based intranet at Coca Cola in Australia. the homepage will be the main page, other links will only be viewed for short amounts of time. is there anyway to make it so, if there is no activity for an amount of time (say 5 minutes) the page will refresh to the homepage ? I have tried Combining these to codes that i have found off the net, but just cant get it to work - THIS CODE IS FOR AUTO REFRESH <head> <title>Auto Reload</title> <script language="JavaScript"> <!-- var time = null function move() { window.location = 'http://yoursite.com' } //--> </script> </head> <body onload="timer=setTimeout('move()',3000)"> <p>see this page refresh itself in 3 secs.<p> </body> THIS CODE IS FOR NOTICE WHEN INACTIVE <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" /> <title>5 seconds mouse inactivity</title> <script language="javascript"> var activity; document.documentElement.onmousemove = function() { clearInterval(activity); activity = setInterval(saySomething, 5000); } function saySomething() { alert("it's been 5 seconds that your mouse didn't move Smile"); } </script> </head> <body onload="activity=setInterval(saySomething, 5000);"> </body> </html> I want it to Load a Page When Inactive, rather then Alert Similar TutorialsHey, Ok so on my site it uses Ajax. Now if i try to submit a comment when i click submit it refreshes the whole page and does nothing! After the page had been refresed I can commetn on the script again and it shows the text i entred on the page with no refresh. Why does it refresh the page on the 1st post?? The site is he http://www.runningprofiles.com/members/Admin HTML Code: <div align="center"> <table width="500" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <table style="WIDTH: 500px" cellspacing="0" cellpadding="0" align="center"> <tr> <td align="center"> <strong>What are you doing?</strong></td> </tr> <tr> <td align="center" valign="middle" class="update_box"> <form method="post" action=""> <textarea cols="5" rows="10" id="content"></textarea> <div id="button_block"> <input name="submit" class="comment_button" type="submit" id="button" value=" Share "/> <input type="submit" id='cancel' value=" cancel" /> </div> </form> </td> </tr> </table> <div id="flash" align="left" ></div> <div id="update" class="timeline"></div> <?php $small1=mysql_query("select * from messages2 order by msg_id desc LIMIT 5"); while($r=mysql_fetch_array($small1)) { $id=$r['msg_id']; $msg=$r['message']; $times=$r['time']; ?> <table id="table_<?php echo $id; ?>" width="100%" > <tr> <td colspan="4"> <hr style="COLOR: #6d7b8d; HEIGHT: 1px; BACKGROUND-COLOR: #a9d0f5" /> </td> </tr> <tr> <td valign="top" width="10%" rowspan="2"><img height="40" alt="Pic" src="http://www.gravatar.com/avatar.php?gravatar_id=7d09b47edf3bdbedb4cb104fb507c3df" width="40" border="1" longdesc="http://www.gravatar.com/avatar.php?gravatar_id=7d09b47edf3bdbedb4cb104fb507c3df" /></td> <td valign="top" align="left" width="12%"><strong>Jarratt</strong></td> <td valign="top" align="left" width="63%"> <?php echo $msg.'....'.$id;?> </td> <td valign="top" align="right" width="15%"><div class="UIStory_Hide"><a href="#" id="de<?php echo $id ?>" class="delete_update" title="Delete Update">X</a></div> </td> </tr> <tr> <td align="left" colspan="3"> <span class='feed_link'><a href="#" class="comment" id="<?php echo $id; ?>"><font color="#cc0000">Reply</font></a></span> <span style="FONT-SIZE: 10px; color:#cc0000; COLOR: #a9a9a9"> <?php echo time_stamp($times) ?></span><br /><br /> <?php //Here $id is main message msg_id value. $csql=mysql_query("select * from comments where msg_id_fk='$id' order by com_id "); $comment_count=mysql_num_rows($csql); if($comment_count>2) { $second_count=$comment_count-2; ?> <div class="comment_ui" id="view<?php echo $id; ?>"> <a href="#" class="view_comments" id="vi<?php echo $id; ?>"> <span style="COLOR: #696969"><b>View all <?php echo $comment_count; ?> comments</b></span></a> </div> <?php } ?> <div id="view_comments<?php echo $id; ?>"></div> <div id="two_comments<?php echo $id; ?>"> <?php $small=mysql_query("select * from {$prefix}comments where msg_id_fk='$id' order by com_id limit 2 "); ?> <?php while($r=mysql_fetch_array($small)) { $c_id=$r['com_id']; $comment=$r['comment']; $timeofpost=$r['time']; ?> <table width="80%"> <tr> <td align="center" valign="middle" style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid"> <div class="comment_actual_text"> <table style="WIDTH: 100%; BORDER-COLLAPSE: collapse" align="left"> <tr> <td width="15%" style="VERTICAL-ALIGN: middle; TEXT-ALIGN: center"><img style="WIDTH: 30px; HEIGHT: 30px" alt="srinivas" src="http://www.gravatar.com/avatar.php?gravatar_id=7a9e87053519e0e7a21bb69d1deb6dfe" border="1" /></td> <td width="85%" style="PADDING-BOTTOM: 2px; VERTICAL-ALIGN: top; PADDING-TOP: 2px; TEXT-ALIGN: left"> <strong>Jarratt</strong> <?php echo $comment; ?> <br /><span style="FONT-SIZE: 10px; COLOR: #a9a9a9; COLOR: #a9a9a9">10min ago<?php //echo time_stamp($timeofpost); ?></span></td> </tr> </table> <br /></div> </td> </tr> </table> <?php }?><div id="commentload<?php echo $id; ?>" > </div> </div> </td> </tr> </table> <div id='expand_box'> <div id='expand_url'></div> </div> <div id="fullbox" class="fullbox<?php echo $id; ?>"> <form method="post" action="" name="<?php echo $id; ?>"> <textarea class="text_area" name="comment_value" id="textarea<?php echo $id; ?>"> </textarea><br /> <input type="submit" value=" Comment " class="comment_submit" id="<?php echo $id; ?>"/> </form> </div> <?php } ?> </td> </tr> </table> </div> I'm currently updating some online forms using HTML. When the page is refreshed (either manually, or by pressing a button) the page redirects to the top. Is there any code that will refresh the page to the last position before the refresh. Ex: If you are half way down the page, and click an "Add" button, the page will refresh back to that same spot. Any help would be great. Thanks, Sarah Hi All, I want to refresh the contents of IFrame without refreshing the whole page.....How is it possible... Just out of curiosity, if a server returns a page with code 3xx and a "Location: url_1" header, but also includes a <meta http-equiv="refresh" content="0;url=url_2"/> tag, then would the browser be expected to redirect to url_1 or url_2? I have this problem, Put the script on my page. in this script the people vote but When they return to the site the text of this form again at 1 and not recognized the vote.As I keep the voting when users refresh the page <form name="HOME"> <input type="text" value="1" name="CASA"> <input onclick="document.HOME.CASA.value = Number(HOME.CASA.value)+1;" type="button" value="Vote"> </form> As I keep the voting when users refresh the page Hello I have a web page where I display 2 frames The bottom frame is a link to REPORT SERVICE Every day at 5 am server does RESTART and then I get an error (split screen is open 24 hours) How do I do REFRESH automatically after receiving an error? Thanks in advance i developing a web application one of page has following code Code: <frameset rows="12%,70%,12%" border="0" > <frame src="Frame/header.html" scrolling="no"> <frameset cols="28%,*" border="0" > <frame src="Frame/Menu.html" scrolling="no" > <frame src="Frame/content.html" name="ShowContentArea" scrolling="auto"> </frameset> <frame src="Frame/footer.html" scrolling="no"> </frameset> now for the second frameset , my problem is as below menu.html contains a dynamic tree structure , clicking on which m contents are displayed in content.html Now there is one more link to add a menu item in menu.html, if i click on that link the respective form to add menu item is displyaed After submission of the form the menu item is added to database but not reflected in menu.html as a another menu item . But if i refresh the whole page that menu item is get displayed That means i just want to set the refresh value of the whole page after adding a new item !!!!!!! but i tried a lot but failed , thats whay i need ur help , please help me guyes Thanks I'm working on an HTML page that is going to be an iFrame on another page. The innerHTML of the iFrame page is set to automatically refresh every 20 seconds. The problem is that when that page refreshes, it "flashes" a white background for about 2 seconds before loading the background and content. How can I prevent that from happening every time it refreshes? Here is the page that has the problem: http://www.mattscss.com/rtb/template Here is the page that has the above link as an iFrame: http://www.mattscss.com/wzmr/wzmr_wmp.htm my webpage is divided by div. i face a problem which is, i want to open a link which will refresh the whole page instead of refresh the div. i'm not familiar using div, need help from someone plz..... thanks in advance... Hello guys, first time posted, long time watcher! Really wanted a little bit of advice on something i'm trying to do at work. We use a web based helpdesk system to log our technical support calls, but it kicks us out every 10 mins if we leave our desk for something and have to go through the long process of logging in again. I was woundering if i created a frame set in another window and kept refresh the home base of the helpdesk system every say 1 min it would keep the connection up. Is this possible? Dave -------------------------------------------------------------------------------- Hey How can i wrote a program that refresh a web page and checks if a certain string is in the page ? I want to refresh the page after clicking submit button with interval of 10 seconds. How can I do that? Hi Does anyone know of a way to make webpages instantly refresh themselves when they are viewed. I'm changing content daily and having bother with people not being able to see all the new stuff as they are loading yesterday's page from their cache. Any help would be greatly appreciated. This is my first time posting here and was needing some help regarding auto refresh in html. I have a web page on our local network for my work that uploads screen shots of security cameras around the different locations. I have the page set to auto refresh and when it does refresh to redirect to another page that has a different set of cameras on it. The redirect works but the problem is after leaving this page up and running for several hours it will get stuck after a redirect and will keep trying to load the page for hours and wont redirect. It usually gets stuck on grabbing one of the images of the cameras, and then has problems displaying the image which then causes the page to sit and try to load for hours with no redirect. I was just wondering if there is anything that i can do for this? I am new to html and dont know much so any help will be greatly appreciated. Dpat I really need help on this this is the original code : - Code: <html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="Andy Moo http://locationdetection.mobi/"> <title>TEST1</title> </head> <body> <div id="geo" class="geolocation_data"></div> <?php include 'geojavascript.php'; ?> </body> </html> I would like to add ajax auto refresh.. to refresh the div link which is something like this : - Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script src="http://ajax.googleapis.com/ajax/ libs/jquery/1.3.0/jquery.min.js"></script> <script> var auto_refresh = setInterval( function() { $('#geo').fadeOut('slow').load('geojavascript.php').fadeIn("slow"); }, 20000); </script> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="Andy Moo http://locationdetection.mobi/"> <title>Locator</title> </head> <body> <div id="geo" class="geolocation_data"></div> <?php include 'geojavascript.php'; ?> </body> </html> But, there is something wrong here... instead of refreshing the div.. it refresh html page only.. not the div data.. anyone.. please help me on this ? thanks in advance guys... My IE is configured to automatically find the most rexent page, so when I address a website I see the current page. However, Safari and Firefox do not seem to have this optiion. So, when users address my website with those browsers they have to push the refresh button to be sure they are seeing my site's latest page. Yet when I use those browsers to access websites other than my own, I seem to get the latest page. This suggests that there may be a way to include in a page file a code that forces refresh. I know that there is a code ("no archive") that does the job where a search engine is involved, but how do I handle this problems where my URL is being directly addressed? Hi everybody... I'm trying to create a simple html page, with these functionalities... - the page is divided into 2 parts (10%, 90%) horizontally - in the top there is a field to write an URL, and an OK button, to load the url to the bottom part - after that the program searches for a string. if the string is on the webpage, sends an emailt to a specified email address, if the string isn't on the loaded page, after a while (5 minutes) reloades the bottom part (the url in the top part), and searches for the string again... Does somebody have an idea, how to start? Please help me, I'm not a great html coder, I need some instructions... Hello I just started an online radio, with stats, but my problem, i want only the stats to reset, not the whole site, cause everytime the whole site refreshes, the radio refreshes to. Here is a pic: here is the php "radio_stats.php" source: HTML Code: <html> <head> <body bgcolor="e9e6f4"> <font color="navyblue"><?php // Shoutcast Server Stats // Parses shoutcasts xml to make an effective stats thing for any website // Coded by Daniel Brown. Edited by Nick Coates [SharpeHosting.com] [SharpeNews] KEEP THIS INTACT!!! // Please refer to the readme file for use. include('config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone $scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 10); if(!$scfp) { $scsuccs=1; echo''.$scdef.' Habbo Hotel Radio Is Currently Offline'; } if($scsuccs!=1){ fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); while(!feof($scfp)) { $page .= fgets($scfp, 1000); } ###################################################################################################################### /////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //define xml elements $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS"); $y=0; while($loop[$y]!=''){ $pageed = ereg_replace(".*<$loop[$y]>", "", $page); $scphp = strtolower($loop[$y]); $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed); if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE) $$scphp = urldecode($$scphp); // uncomment the next line to see all variables //echo'$'.$scphp.' = '.$$scphp.'<br>'; $y++; } //end intro xml elements ###################################################################################################################### ###################################################################################################################### /////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //get song info and history $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed); $songatime = explode("<SONG>", $pageed); $r=1; while($songatime[$r]!=""){ $t=$r-1; $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]); $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]); $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]); $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page); $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed); $r++; } //end song info fclose($scfp); } //display stats if($streamstatus == "1"){ //you may edit the html below, make sure to keep variable intact echo' <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <META HTTP-EQUIV="REFRESH" CONTENT="120"> <link rel=stylesheet href="" type="text/css"> <title>'.$scdef.'</title> </head> <body text="" bgcolor="e9e6f4"> <p> <font color="black"><font face="verdana" size="1"><b>DJ:</b> '.$servertitle.'</font></p> <font color="black"><font face="verdana" size="1"><b>Lytte </b> '.$currentlisteners.' / 200</font></p> <font face="verdana" size="1" color="black"><b> Sang:</b> '.$song[0].'</font></p> <b> <font face="verdana" size="1"> Siste Sang:</font></b> <font color="black"><font face="verdana" size="1"> '.$song[1].' </font> </body> </html>'; } if($streamstatus == "0") { //you may edit the html below, make sure to keep variable intact echo' <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <link rel=stylesheet href="" type="text/css"> <title>HabbXtra Radio er offline!</title> </head> <body text="" bgcolor=""><STYLE type=text/css> UNKNOWN { FONT-SIZE: 10px; COLOR: #black; FONT-FAMILY: verdana } BODY { BACKGROUND-COLOR: e9e6f4 } A:link { COLOR: ; TEXT-DECORATION: none } A:visited { COLOR: #363636; TEXT-DECORATION: none } A:hover { COLOR: #363636; TEXT-DECORATION: underline } A:active { TEXT-DECORATION: none } BODY { FONT-SIZE: 10px; COLOR: e9e6f4; FONT-FAMILY: verdana } TD { FONT-SIZE: 10px; COLOR: e9e6f4; FONT-FAMILY: verdana } TH { FONT-SIZE: 10px; COLOR: e9e6f4; FONT-FAMILY: verdana } .style5 {font-size: 14px} </STYLE> <div><center><img src="offline.gif"></img></center></div> </body> </html>'; } ?></font> </body> My html source can you see at: http://habbxtra.net/hjem.php Thanks Is this the correct code to use to auto-refresh a web page? It is not working for me. Is there something I'm missing? <META HTTP-EQUIV="Refresh" CONTENT="60; URL=http://website.com/"> Thank you. Hello, I am working on building a page for our school deli. The college website uses an online interface to edit and build pages. There is a server where images are uploaded that can be used on the pages. Here is an example of the HTML code for inserting a picture. <p><img src="/food/PublishingImages/VeteransDay.jpg" alt="" /> </p> What I need is to set it so that there is a bank of images and it will randomly select one whenever the page is accessed so that the same image is not shown all the time. I have tried different codes, but nothing seems to work. Here is an example of a different section I built that links to another page so you can kinda see how the interface works. <p style="text-align: right; "> </p> <p style="text-align: right; "> </p> <p style="text-align: right; "> </p> <p style="text-align: right; "> </p> <p style="text-align: right; "> </p> <h1 style="text-align: right; "><span style="color: rgb(51, 89, 52);" class="Heading"><b>DELI MENU </b></span></h1> <p style="text-align: center; "> </p> <h2 style="text-align: right; "><a href="http://villagemarketcollegedale.com/Sales/deli%20menu%20mar%205-9.pdf">MARCH 5 - 9</a></h2> <h2 style="text-align: right; "><a href="http://villagemarketcollegedale.com/Sales/deli%20menu%20mar%2012-16.pdf">MARCH 12 - 16</a></h2> <h2 style="text-align: right; "><a href="http://villagemarketcollegedale.com/Sales/deli%20menu%20mar%2019-23.pdf">MARCH 19 - 23</a></h2> <h2 style="text-align: right; "><a href="http://villagemarketcollegedale.com/Sales/deli%20menu%20mar%2026-30.pdf">MARCH 26 - 30</a></h2> Hopefully I am posting this in the right location. Let me know if you need any additional info. It is possible that the interface will not accept certain code. |