PDA

View Full Version : Javascript help


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?

EnIgMa1234
02-21-2007, 03:12 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=139312" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=139312</a>

HPIA
02-21-2007, 08:01 PM
Well, thanks, I didnt know someone already had that up. I was hoping for an explanation to why I was getting an error when I put that code in the header template, but I could just use his instead...