<html>
<head>
<title>cookie</title>
<script type = "text/javascript">
var user_name;
var del = new Date();
document.write(del.toGMTString());
function check() {
user_name = document.getElementById("user").value;
del.setFullYear(del.getFullYear() + 1);
document.cookie = escape("name") + "=" + escape(user_name) + ";expires = "+ del.toGMTString();
alert(document.cookie);
}
</script>
</head>
<body>
<form>
username : <input type = "text" id = "user"></input>
<input type = "button" value = "enter" onClick = "check()"></input>
</form>
</body>
</html>
Cookie 不想在 chrome 中提醒,但它在 Firefox 中有效,但只显示用户名。有人有什么建议吗?