F@bio wrote on 04 Dec 2003:
I'd like to point out that that page works fine in Opera 7 (Win).
Your page (reformatted slightly):
You haven't included a DOCTYPE declaration. Before the HTML element,
you should include either this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
or this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"
http://www.w3.org/TR/html4/strict.dtd">
depending upon what elements and attributes you use. The latter is
preferable, but you'll probably need to change how you author pages.
<html>
<head>
<title>Cookie Test</title>
<script language="javascript">
The attribute, language, is deprecated and doesn't need to be used.
The type attribute, however, is /required/ and must be used. Change
that line (and the one later) to:
<script type="text/javascript">
function updateCookie() {
Neither of these two statements below have terminating semi-colons
(
. That could be part of your problem, but as I said, it worked
nevertheless.
document.cookie=document.myform.cookie.value
To access form elements, you should use the 'collection' syntax. It
works across more browsers:
document.cookie = document.forms['myform'].elements['cookie'].value;
Note the semi-colon, above.
location.reload(true)
}
</script>
You don't declare the default scripting language, which you /must/ do
if you use intrinsic events (onclick, etc). Add this:
<meta http-equiv="Content-Script-Type" content="text/javascript">
</head>
<body>
<script language="javascript">
Again, no type attribute (above) and no semi-colon (below).
document.write("Cookie value: "+document.cookie)
</script>
<form action="" name="myform">
<p>Definy the cookie value: <input type="text" size="60"
name="cookie"></p>
<input type="button" name="setCookie" value="Set Cookie"
onClick="updateCookie()">
</form>
<hr>
On Internet Explorer 5 for Mac (OS 9) and Opera 6 for PC doen't
seem to work!
</body>
</html>
Try these changes and test the page for yourself again: I can't - I
only have IE6 and Opera 7 (both Win), and it works in both of them.
Good luck,
Mike