Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Javascript to open different page at different times?
Anyone know some javascript to open a different page based on the time of the day? Here is javascript to show a different image at different times. Got any idea how to open a different page at different times? Thank you. -- Corey Chambers
var current= new Date()
var day_night=current.getHours()
if (day_night<=12)
document.write("<img src='day.gif'>")
else
document.write("<img src='night.gif'>")
1 Answer
- Anonymous1 decade agoFavourite answer
Replace the document.write calls with an assignment to window.location?