读取cookie

读取cookie信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script type="text/javascript" src="js/user.js"></script>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>

<script type="text/javascript">
$(function(){
var U2NickName=$.cookie('U2NickName'); // 读取 cookie
if (U2NickName!=null&&U2NickName!="") {
$("#xingm").html(U2NickName);
$("#login_form").hide();
}else{
$("#xingm").hide();
$("#logoutBtn").hide();
}