It's pretty basic(testing, playing around), but It gets stuck on the document.cookie. the syntax is however taken out a published example (ISBN ...... lol)
:s
I just don't want to copy/paste a script...
anyhow:
<html>
<head>
<title>testing cookies</title>
<script language="JavaScript" type="text/javascript">
<!--
function cook(){
var name = prompt("What is your name", "Type you name here");
alert(name); // look wherever I didn't make code typo's
var datum;
datum=new Date;datum.setMonth(datum.getMonth()+3);
alert(datum); // look wherever I didn't make code typo's
document.cookie="surfername=" + name + "; expires=" + datum.toGTMString();
}
//-->
</script>
</head>
<body bgcolor="red">
Testing!!!!
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Cookie" onclick="javascript:cook()">
</body>
</html>
:s
I just don't want to copy/paste a script...
anyhow:
<html>
<head>
<title>testing cookies</title>
<script language="JavaScript" type="text/javascript">
<!--
function cook(){
var name = prompt("What is your name", "Type you name here");
alert(name); // look wherever I didn't make code typo's
var datum;
datum=new Date;datum.setMonth(datum.getMonth()+3);
alert(datum); // look wherever I didn't make code typo's
document.cookie="surfername=" + name + "; expires=" + datum.toGTMString();
}
//-->
</script>
</head>
<body bgcolor="red">
Testing!!!!
<input type="button" value=http://www.webdeveloper.com/forum/archive/index.php/"Cookie" onclick="javascript:cook()">
</body>
</html>