cookie设置代码如下<script type="text/javascript">
<!--
function Cookie()
{
this.SetCookie = function(name, value, expires) {
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires.toGMTString() : "" );
};
this.GetCookie = function( name ){
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]); return null;
};
} var cookie = new Cookie();
cookie.SetCookie("Csdn", 2009);
alert(cookie.GetCookie("Csdn"));
//-->
</script>在IE,FF,Opera下测试有效(2009),但在Chrome浏览器下为NULL。了解的看下。
<!--
function Cookie()
{
this.SetCookie = function(name, value, expires) {
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires.toGMTString() : "" );
};
this.GetCookie = function( name ){
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]); return null;
};
} var cookie = new Cookie();
cookie.SetCookie("Csdn", 2009);
alert(cookie.GetCookie("Csdn"));
//-->
</script>在IE,FF,Opera下测试有效(2009),但在Chrome浏览器下为NULL。了解的看下。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货