📄 cookie.js
字号:
/**
* Actuate Corporation
* Copyright (C) 2003 Actuate Corporation. All rights reserved.
*/
var g_cookieWritingEnabled = true;
///////////////////////////////////////////////////////////////////////////////
// Globals
///////////////////////////////////////////////////////////////////////////////
function dbout(value)
{
// alert(value);
}
///////////////////////////////////////////////////////////////////////////////
function readCookie( key )
{
var value = "";
var allcookies = document.cookie;
dbout( allcookies );
var pos = allcookies.indexOf( key + "=");
if ( pos != -1 )
{
var start = pos + key.length;
var end = allcookies.indexOf( ";", start );
if ( end == -1 )
end = allcookies.length;
value = allcookies.slice( start+1, end );
value = decodeCookie(value);
}
return value;
}
///////////////////////////////////////////////////////////////////////////////
function writeCookie( key, value, expirationDate, path )
{
if (!g_cookieWritingEnabled) {
return;
}
cookieString = key + "=" + encodeCookie(value);
if ( expirationDate )
{
cookieString += ";expires=" + expirationDate;
}
if ( path )
{
cookieString += ";path=" + path;
}
document.cookie = cookieString;
}
///////////////////////////////////////////////////////////////////////////////
function listCookies()
{
dbout( 'in listCookies cookies = ' + document.cookie );
}
///////////////////////////////////////////////////////////////////////////////
function clearCookies()
{
document.cookie = "";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -