GetDotted Domains

Viewing Thread:
"Some JavaScript Help"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sun 10/11/02 at 17:24
Regular
Posts: 787
Trying to write a script that lobs up an alert box at a certain time preset by the user. However, the alert box never comes up. I've toyed with it all afternoon and everything I've tried has failed.

function the_TIME_now()
{
var date=new Date()
var hours=date.getHours()
var mins=date.getMinutes()
if (mins < 10)
mins="0"+mins
var secs=date.getSeconds()
if (secs < 10)
secs="0"+secs
the_time=hours+mins+secs
the_time_now=setTimeout("the_TIME_now()",001)
return the_time_now
while( eventStart != the_time_now)
the_TIME_now()
while (eventStart == the_time_now)
alert('NOW!')
}
var eventStart=prompt("What time does it start?","")

It doesn't work (I *think*) because the eventStart time is never and never can be the_time_now. I did a test for this and it proved moi correct. The problem is, I have no idea of how to resolve this.

Can you help?

Cheers
Sun 10/11/02 at 18:49
Regular
"You've upset me"
Posts: 21,152
Wooooooo, it works :-D

Thanks a lot for that I may actually be able to watch something I want to now :-D

Any idea where I went wrong?

Cheers again :-D
Sun 10/11/02 at 18:34
Regular
"It goes so quickly"
Posts: 4,083
Best I can do so far. Altered a Clock script a little.

Enter the time in 24 hour type, like '18:50' or '09:15', etc

You can ignore the bullet point check boxes, but if you change between them the Script seems to stop working, but try this for now

=======================================

Clock Type




Military Time

12 Hour Time


Sun 10/11/02 at 18:07
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> Don't appear to have anything like that I'm afraid. It's actually a
> tricky little script your after :o)

Hehe :-) It's sole purpose is to let me know when a programme I want to watch is starting because I always seem to lose track of time when I'm on the computer.
>
> When someone enters some input into the prompt box, what layout are
> you intending???
>
> i.e.
>
> 03:15
> 3:15pm
> 15:15
>
> ...etc?

at first I was after 14:30:00 type thang, simply because I couldn't be bothered to get rid of the seconds :-D

At the moment though it's 153000 because I wanted to actually get it working before I made it look nicer :-) I thought that was actually the problem at first but now I'm not so sure it is.
Sun 10/11/02 at 17:54
Regular
"It goes so quickly"
Posts: 4,083
Don't appear to have anything like that I'm afraid. It's actually a tricky little script your after :o)

When someone enters some input into the prompt box, what layout are you intending???

i.e.

03:15
3:15pm
15:15

...etc?
Sun 10/11/02 at 17:51
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> I tried a little alterations, and managed to completely crash my
> computer, so I won't suggest what I wrote.
>
Heh :-D

> I might have something saved somewhere though, check back in a little
> bit ok

Ok, cheers :-D
Sun 10/11/02 at 17:45
Regular
"It goes so quickly"
Posts: 4,083
I tried a little alterations, and managed to completely crash my computer, so I won't suggest what I wrote.

I might have something saved somewhere though, check back in a little bit ok
Sun 10/11/02 at 17:43
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> Did you create this yourself of get it from another Web Site/Book etc?

I wrote it myself.
Sun 10/11/02 at 17:41
Regular
"It goes so quickly"
Posts: 4,083
Did you create this yourself of get it from another Web Site/Book etc?
Sun 10/11/02 at 17:37
Regular
"You've upset me"
Posts: 21,152
cjh wrote:
> Not to sure about this one. The only thing I can see so far is that if
> you change the while bits to if statments, it will keep looping until
> the alert bit is true:
>
> if (eventStart != the_time_now) {
> the_TIME_now();
> } else {
> alert('NOW!')
> }

I tried that originally and it didn't work, and it still doesn't now. Bah. Thanks anyway.
Sun 10/11/02 at 17:30
Regular
"It goes so quickly"
Posts: 4,083
Not to sure about this one. The only thing I can see so far is that if you change the while bits to if statments, it will keep looping until the alert bit is true:

if (eventStart != the_time_now) {
the_TIME_now();
} else {
alert('NOW!')
}

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Unrivalled services
Freeola has to be one of, if not the best, ISP around as the services they offer seem unrivalled.
Everybody thinks I am an IT genius...
Nothing but admiration. I have been complimented on the church site that I manage through you and everybody thinks I am an IT genius. Your support is unquestionably outstanding.
Brian

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.