WindowStore.init(cookieName, expired)
cookieName : 保存クッキー名(デフォルト:__window_store__)
expired : 期限
win02 = new Window("win02", {
title: "ウィンドウ02", className: "dialog", top:150, left:120, zIndex: 101,
width:320, height:240, resizable: true, draggable:true });
win02.show();
}
function saveWindowData(){
WindowStore.init("__window_store__", new Date("2007/12/6"));
}
function checkCookie(){
alert(getCookie("__window_store__"));
}
// クッキー読み出し
function getCookie(theName__)
{
theName__ += "=";
theCookie__ = document.cookie+";";
start__ = theCookie__.indexOf(theName__);
if (start__ != -1)
{
end__ = theCookie__.indexOf(";",start__);
return unescape(theCookie__.substring(start__+theName__.length,end__));
}
return false;
}
// --></script>
</head>
<body>
<h1>ウィンドウの状態を保存する</h1>
<form>
<input type="button" value="保存する" onClick="saveWindowData()">
<input type="button" value="クッキーを表示" onClick="checkCookie()">
</form>
</body>
</html>