How would i make a simple web page that reflects the hour of the day when the page is loaded. For example, i want to make it so when they go to my website, at 5am til noon, a certain image is displayed as well as what is written on the page and the background color, etc. And if they visit the site from noon til 6pm it shows up a different image, content, etc. i'm new to this forum and new to javascript. thanks you guys
The solution will vary depending if you want your different content with server time or with client time. That's because when it's 5am on some country its 8am or 4pm on others. Also, client time it's no so reliable as server time.
yeah i know that. that doesnt affect what i want to happen. i want it to be based off of the servers time.
Well, you can use two different methods: 1.- Generate different content on server based on time. Maybe that's no good on SEO terms because crawlers could see you content changing everytime. But you're sure that clients with javascript disable will get what you want. 2.- Generate same content on server, except some javascript variable. Then a javascript function will use that variable to show picture1 or picture2 or whatever.