A
AAaron123
I'm trying to check that both javascript and cookies are enabled.
The folloing code does not compile.
Error message is that cc()
is not a member of 'ASP._main_master'.
Main.Master is the name of the file.
I can't find anything wrong and don't know how to check further.
1)Can you see what might be wrong?
2)Does the approach look good? I'm especially concerned that I may be
missing something in the approach.
3)Also, I wonder why I always see the // before --> so it is not taken to be
script but why isn't <!-- taken to be script?
<head runat="server">
<script type="text/javascript">
<!--
function cc()
{
/* check for a cookie */
if (document.cookie == "")
{
/* cookie is not found */
} else {
/* this sets the value to true if cookie and javascript are both
enabled*/
document.form2.scriptcookieexists.value = "true";
}
}
/* Set a cookie to be sure that one exists.*/
document.cookie = 'killme' + escape('nothing')
// -->
</script>
</head>
....
document.cookie = 'killme' + escape('nothing')
// -->
</script>
....
<body onload="cc()">
....
form id="form2" >
<input type="hidden" name="scriptcookieexists" value="false"/>
</form>
The folloing code does not compile.
Error message is that cc()
is not a member of 'ASP._main_master'.
Main.Master is the name of the file.
I can't find anything wrong and don't know how to check further.
1)Can you see what might be wrong?
2)Does the approach look good? I'm especially concerned that I may be
missing something in the approach.
3)Also, I wonder why I always see the // before --> so it is not taken to be
script but why isn't <!-- taken to be script?
<head runat="server">
<script type="text/javascript">
<!--
function cc()
{
/* check for a cookie */
if (document.cookie == "")
{
/* cookie is not found */
} else {
/* this sets the value to true if cookie and javascript are both
enabled*/
document.form2.scriptcookieexists.value = "true";
}
}
/* Set a cookie to be sure that one exists.*/
document.cookie = 'killme' + escape('nothing')
// -->
</script>
</head>
....
document.cookie = 'killme' + escape('nothing')
// -->
</script>
....
<body onload="cc()">
....
form id="form2" >
<input type="hidden" name="scriptcookieexists" value="false"/>
</form>