代码如下 | 复制代码 |
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312" /> <title></title> <script> document.getcookie = function(sname) { // cookies are separated by semicolons var acookie = document.cookie.split("; "); for (var i=0; i < acookie.length; i++) { // a name/value pair (a crumb) is separated by an equal sign var acrumb = acookie[i].split("="); if (sname == acrumb[0]) return decodeuricomponent(acrumb[1]); } // a cookie with the requested name does not exist document.setcookie = function(sname, svalue, sexpires) document.cookie = scookie; document.removecookie = function(sname,svalue) <body> |
时间: 2024-10-11 15:18:06