JS获取Cookie值

    function GetLoginCookie() {
var userCookie = getCookie("mycookie");
var loginname = userCookie.split('loginname=')[1];
loginname = unescape(loginname.split('&')[0]);
alert(loginname);
}
function getCookie(name) {
var prefix = name + "="
var start = document.cookie.indexOf(prefix);
if (start == -1) {
return null;
}
var end = document.cookie.indexOf(";", start + prefix.length)
if (end == -1) {
end = document.cookie.length;
}
var value = document.cookie.substring(start + prefix.length, end)
return unescape(value);
}
上一篇:ssdb主从及双主模型配置和简单管理


下一篇:在C#中使用WIA获取扫描仪数据