But there are two problems.
1. From another page in the site, when I return to the HOME page, the prompt reappears even though I've already entered a USERNAME.
2. The other pages don't greet the user. The Hi, USERNAME doesn't appear.
Could someone offer some help with this?
I've been looking at the code too long to see where the mistake(s) are.
Thank you very much.
TokyoJ
The HOME page / default URL page has this:
<head>
<script language = "JavaScript">
<!--
function writeCookie()
{// -->
var username = prompt("What's your name?", "");
var username = "username=";
document.cookie = username;
}
</script>
</head>
Then all other pages have this:
<head>
<title> Contact Details </title>
<script language="JavaScript" </script>
<script language="JavaScript" type="text/javascript">
if (GetCookie("username"))
{</script>
write("Hi" + GetCookie("username"));
}
</head>