您的位置:首页 > Web前端 > JavaScript

在javascript中进行cookie的读写操作

2009-11-04 22:43 525 查看
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script>
<script src="jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("#setcookie").click(function() {
$.cookie("test", "chenxizhang");
}); $("#getcookie").click(function() {
alert($.cookie("test"));
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" value="设置cookie" id="setcookie"/>
<input type="button" value="读取cookie" id="getcookie"/>
</form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: