/    Sign up×
Community /Pin to ProfileBookmark

adding setences automaticly

Hi, I want to put sentences in a page…like start at 9pm and ads more sentences like 5 in 5minutes, not erasing the others.

how can I do it in javascript?

thanks

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@JonaSep 04.2004 — [font=trebuchet ms]Could you explain more thoroughly, please?[/font]
Copy linkTweet thisAlerts:
@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

thanks
Copy linkTweet thisAlerts:
@vwphillipsSep 04.2004 — <i>
</i>&lt;html&gt;

&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta name="description" content=""&gt;
&lt;meta name="keywords" content=""&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div id=txtbox style="border:solid black 1px;width:400px;height:200px;text-align:center;"&gt;&lt;/div&gt;
&lt;script language="JavaScript"&gt;
&lt;!--
var TextAry=new Array('Text will write every 5 seconds&lt;br&gt;','Text2222222222222&lt;br&gt;','Text3333333333333333&lt;br&gt;');
var MyText='';
var Cnt=0;

function Write(){
MyText+=TextAry[Cnt];
document.getElementById('txtbox').innerHTML=MyText+'&lt;br&gt;';
Cnt++;
if (Cnt&lt;TextAry.length){ setTimeout('Write()',5000); }

}

Write();


&lt;!----&gt;
&lt;/script&gt;

&lt;/body&gt;

&lt;/html&gt;


Is this the sort of thing?
Copy linkTweet thisAlerts:
@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).

That is my best understanding ... Dr. Script
Copy linkTweet thisAlerts:
@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.

thanks
Copy linkTweet thisAlerts:
@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.

Dr. Script
×

Success!

Help @devil_online spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...