HPIA
02-21-2007, 03:34 AM
Hey!
I want to make a little code that allows a little message to come up in the breadcrumb to display good morning, good afternoon, and good evening.
I have the code:
<script type="text/javascript">
var d = new Date()
var time = d.getHours()
if (time<10)
{
document.write("<b>Good morning,</b>")
}
else if (time>10 && time<16)
{
document.write("<b>Good afternoon,</b>")
}
else
{
document.write("<b>Good evening,</b>")
}
</script>
But I don't know how to incorporate $username into the javascript so it would say like "Good Afternoon, HPIA" instead of "Welcome, HPIA". Does anyone know what I mean?
I want to make a little code that allows a little message to come up in the breadcrumb to display good morning, good afternoon, and good evening.
I have the code:
<script type="text/javascript">
var d = new Date()
var time = d.getHours()
if (time<10)
{
document.write("<b>Good morning,</b>")
}
else if (time>10 && time<16)
{
document.write("<b>Good afternoon,</b>")
}
else
{
document.write("<b>Good evening,</b>")
}
</script>
But I don't know how to incorporate $username into the javascript so it would say like "Good Afternoon, HPIA" instead of "Welcome, HPIA". Does anyone know what I mean?