Display message along with name stored in cookie

I have a prompt box appear onLoad that asks for a persons name. I am trying to get the text in the page to say "Good Morning, ‘username’ ".

for the onLoad I want to use onLoad=“checkCookie()” but it won’t write the “message” with the name and will load a seperate page.

Basically what I am asking is how can I get the message + the name pulled from the cookie to display on the page?

var message = (depends on the time of day, Good Morning or Good Afternoon)
var username = (whatever the user puts in the prompt box)

[code][/code]

I did a lot of fiddling around and basically just need to figure out why there is an undefine at the end.

I stored the checkCookie() in an external file.

Is there a better way to do the document.write so that it isn’t writing the function?

Inside the function I have it do a doc.write to so I am basically doing a doc.write(doc.write(checkCookie()))

I’m going to finish this but I solved it by writing out that last sentenced…

Original Code

[code]

[/code]

Fixed Code

<script type="text/javascript">
         checkCookie()
</script>
Sponsor our Newsletter | Privacy Policy | Terms of Service