Need help setting js cookie
Posted: Thu Aug 23, 2012 1:23 pm
I'll preface this by saying I know NOTHING about javascript...
I've looked at tons of tutorials, but I clearly must be missing something, because I can't get any of them to work.
But it doesn't seem to be writing the cookie. Can someone tell me what I'm going wrong?
I've looked at tons of tutorials, but I clearly must be missing something, because I can't get any of them to work.
Code: Select all
<script type="text/javascript">
<!--
function WriteCookie()
{
cookievalue= "813-653-1111" + ";";
cookie="localnumber=" + cookievalue;
}
WriteCookie();
//-->
</script>
</head>
<body>
<script type="text/javascript">
document.write(getCookie("localnumber"));
</script>