@devil_onlineauthorSep 04.2004 — #well, I want to print information in the page, in keep printing for exemple in about 5 in 5 minutes, and not erasing the previsious information
<body> <div id=txtbox style="border:solid black 1px;width:400px;height:200px;text-align:center;"></div> <script language="JavaScript"> <!-- var TextAry=new Array('Text will write every 5 seconds<br>','Text2222222222222<br>','Text3333333333333333<br>'); var MyText=''; var Cnt=0;
function Write(){ MyText+=TextAry[Cnt]; document.getElementById('txtbox').innerHTML=MyText+'<br>'; Cnt++; if (Cnt<TextAry.length){ setTimeout('Write()',5000); }
@steelersfan88Sep 04.2004 — #I don't believe so. I think the OP wants the text to show up at midnight to be "It is midnight." Then at 12:05, it appends a new line:"It is 12:05" ... etc ...
When you go to the page, it has the sentences there already. If this is correct, you'll need to use a server side language. Dtermine the time from your server, then write all the sentences from a large array of 288 sentences (12 per hour, 24 hours per day).
@devil_onlineauthorSep 04.2004 — #I don't believe so. I think the OP wants the text to show up at midnight to be "It is midnight." Then at 12:05, it appends a new line:"It is 12:05" ... etc ...[/QUOTE]
yes that's exactly what i want..however when were 12h05 I wan't to show "it is 12h05" but not erasing the first information.
I've done this in php with refresh but when display the information of 12h05 does't display the information of 12.00.
@steelersfan88Sep 04.2004 — #Get the time, then loop thru the entire array up until that time. That is your best option.[code=php]$sentences = array( "0:00" => "It is midnight", "0:05" => "It is 12:05", "0:10" => "It is 12:10" );[/code]Then determine time, then loop thru all elements of the array while the time is greater than the array time.