Yahoo Answers is shutting down on May 4th, 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

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Replace the document.write calls with an assignment to window.location?

Still have questions? Get your answers by asking now.