The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

3 Pages V < 1 2 3  
Reply to this topicStart new topic
> Using Time to display a message, I have a script that displays random, I want to predict it.
Martha
post Jun 21 2016, 01:05 AM
Post #41


Novice
**

Group: Members
Posts: 28
Joined: 17-June 16
Member No.: 24,336



okay i think i have it figured out.
24 - (-time zone value) from gmt.
24 set it to gmt
16 sets to west coast usa PST, add 1 for PDT (Pacific daylight time)
34 sets for east Australia/Russia ...

It works. It shows Tuesday and it displays the right message.
*yawn* bed now.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 21 2016, 04:07 AM
Post #42


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Ok, here is the final version. I cleaned up all the switch statements, they were hard to read. Since you are just learning programming indent your code. It is easier to read for people like me to debug. It is also easier for you to read. Everyone wins.

This version contains all the corrections we have talked about. Don't confuse it with older versions. biggrin.gif Also, I edited the document in UTF-16 format and normal single and double quotes work fine for me.
Attached File  TimeScript3DAY..htm ( 18.9k ) Number of downloads: 391
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Martha
post Jun 21 2016, 07:10 AM
Post #43


Novice
**

Group: Members
Posts: 28
Joined: 17-June 16
Member No.: 24,336



Okay I compared the programs side by side, looking at the changes you made, where you added some defaults, removed others. Cleaned up the character count and added some very helpful notes so I can understand which break goes for which item. Next time I create something I'll make sure to remember and keep my indents and spacings so others can read and help easier.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jun 21 2016, 04:07 PM
Post #44


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



One more thing. Since your site will require Javascrit (some people turn it off) you should add a <noscript> section in the HTML. That will show your custom message whenever Javascript is disabled.

I don't know anything about your hosting site but you might want to think about learning a server side language like PHP (Javascript is client side).

This post has been edited by CharlesEF: Jun 21 2016, 04:12 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Martha
post Jun 22 2016, 07:06 AM
Post #45


Novice
**

Group: Members
Posts: 28
Joined: 17-June 16
Member No.: 24,336



I'll look into PHP as time becomes more available to me, might even think about taking a class in computer languages at the College.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

3 Pages V < 1 2 3
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 01:19 AM