伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-12/1198307265.html
}
</script>
Read.htm
以下是引用片段:
<script language="javascript" >
function getCookie(name)
{
/*
*--------------- getCookie(name) -----------------
* getCookie(name)
* 功能:取得变量name的值
* 参数:name,字符串.
* 实例:alert(getCookie("baobao"));
*--------------- getCookie(name) -----------------
*/
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr !=null) return unescape(arr[2]); return null;
}
alert(getCookie("baobao"));
</script>
优点:可以在同源内的任意网页内访问.生命期可以设置.
缺点:值长度有限制.
JavaScript静态页面值传递之Cookie篇
'http://www.etoow.com/html/2007-12/1198307265.html