• 0

cookies confusion


Question

Is the with statement deprecated?should I get another book?

 

Here is the code

 

<script language="Javascript" type="text/javascript">
<!--
function ReadCookie()
{
with (document.CookieReader)
{
if (document.cookie == "")
{
cookiecontent.value = "No cookies"
}
else
{
cookiecontent.value =
document.cookie.split('=')[1]
}
}
}
-->
</script>
</head>
<body>
<form name="CookieReader" action="" >
Cookie: <input type="text" name="cookiecontent" />
<BR>
<INPUT name="Reset"
value="Get Cookie" type="button"
onclick="ReadCookie()"/>
</FORM>
</body>
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.