Top

Time Popup


Javascript Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Oct 02, 2009
Last Updated  Oct 02, 2009
Tags  popup 

Introduction

Weasel's first javascript! on your website it pops up an alert with a response depending on the time!
put it where you'd put html/javascript!



Grab the Code

<html>
<body>
<script type="text/javascript">
//Twango's Differant Time reaction script
var d = new Date();
var time = d.getHours();
if (time >= 1 && time <= 7)
{
alert("Yawn... It's too early...");
}
if (time >= 8 && time <= 10)
{
alert("Breakfast Time!");
}
if (time == 11)
{
alert("Time to walk the dog");
}
if (time >= 12 && time <= 14)
{
alert("Lunch Time!");
}
if (time >= 15 && time <= 16)
{
alert("Time to Watch TV");
}
if (time >= 17 && time <= 18)
{
alert("Dinner Time");
}
if (time >= 19 && time <= 21)
{
alert("Time to get ready for bed");
}
if (time >= 22 && time <= 24)
{
alert("Yawn... It's late");
}
</script>
</body>
</html>

Comments

  (3)  RSS
Cracker200
Comments: 257
 
Javascript Snippet:  Time Popup
Posted on Oct 3, 2009 6:37 pm
Lol Nice work ;D
Joshuaxiong1
Comments: 127
 
Javascript Snippet:  Time Popup
Posted on Nov 13, 2009 9:06 pm
nice! love it!
Weasel
Comments: 117
 
Javascript Snippet:  Time Popup
Posted on Nov 14, 2009 5:30 pm
Lol thanks, i NEED requests!!! here are some languages i can do and how fluent i am in them (1-10)
JavaScript(9)
HTML(10)
CSS(8)
DHTML(9)
Perl(4)

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom