·Î±×ÀÎ ¾ÆÀ̵ð ÄíÅ°·Î ±â¾ïÇϱâ |
|
|
 |
17³â Àü |
<html>
<head>
<script language="javascript">
function setCookie (name, value, expires) {
document.cookie = name + "=" + escape (value) +
"; path=/; expires=" + expires.toGMTString();
}
function getCookie(Name) {
var search = Name + "="
if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
offset = document.cookie.indexOf(search)
if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇϸé
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ À妽º ¹øÈ£ ¼³Á¤
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
return "";
}
function saveid(form) {
var expdate = new Date();
// ±âº»ÀûÀ¸·Î 30Àϵ¿¾È ±â¾ïÇÏ°Ô ÇÔ. Àϼö¸¦ Á¶ÀýÇÏ·Á¸é * 30¿¡¼ ¼ýÀÚ¸¦ Á¶ÀýÇÏ¸é µÊ
if (form.checksaveid.checked)
expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30ÀÏ
else
expdate.setTime(expdate.getTime() - 1); // ÄíÅ° »èÁ¦Á¶°Ç
setCookie("saveid", form.id.value, expdate);
}
function getid(form) {
form.checksaveid.checked = ((form.id.value = getCookie("saveid")) != "");
}
</script>
</head>
<body onLoad="getid(document.mainform)">
<form name=mainform>
¾ÆÀ̵ð <input type=text name=id>
¾ÏÈ£ <input type=password name=pw>
<input type=checkbox name=checksaveid onClick="saveid(this.form)">¾ÆÀ̵ð ±â¾ï
</form>
</body>
</html> |
|
̵̧ : 335 |
̵̧
¸ñ·Ï
|
|