作者: admin

  • 遮罩层,滚动条问题

    今天遇到的问题是,在弹出层后面的 遮罩层,因为有滚动条,导致滚动条下面不可视区域没有遮罩层,解决方式是加的css。

    js代码

    </script>css代码

    #fullbg{ 

    background-color: Gray; 

    display:none; 

    z-index:3;  

    left:0px; 

    opacity:0.5; top:0; left:0;height:100%; width:100%; z-index:999; position:fixed; _position:absolute; _left: expression(documentElement.scrollLeft + documentElement.clientWidth – this.offsetWidth); _top: expression(documentElement.scrollTop + documentElement.clientHeight – this.offsetHeight);

    filter:Alpha(Opacity=30); 

    opacity: 0.3; 

     

    #dialog { 

    width:560px; 

    background:#eee; 

    display: none; 

    z-index: 5; 

    padding:16px;

    font-size:12px;

    z-index:1000; position:absolute;

    }

    #dialog sup{ color:#f00;}

    #dialog .close0{ position:relative; top:-24px; left:544px; height:38px; width:40px;}

     

    html代码

    <div id=”fullbg”></div> 

    <!– end JS遮罩层 –> 

    <!– 对话框 –> 

    <div id=”dialog”>

    <div class=”close0″><a href=”#” onclick=”closeBg();”><img src=”__IMG__/close.png” /></a></div>  

    <div id=”dialog_content”>

    <h3>个人信息</h3>

    <p>(备注:以下信息我们只用于根据需要给您发送相关服务材料,不会对外泄密,敬请理解)</p>

    <table width=”555″ border=”0″ cellspacing=”1″ cellpadding=”0″ class=”yh_table”>

                  <tr>

                    <td width=”65″ bgcolor=”#eeeeee”><sup>*</sup>用户ID</td>

                    <td width=”100″ bgcolor=”#fbfbfb”><b>{$member.MEMBER_NAME}</b></td>

                    <td width=”65″ bgcolor=”#eeeeee”><sup>*</sup>真实姓名</td>

                    <td width=”80″ bgcolor=”#fbfbfb”><b>{$info.NAMES}</b></td>

                    <td width=”60″ bgcolor=”#eeeeee”>性别</td>

                    <td bgcolor=”#fbfbfb”><b><php>echo $gender[$info[‘GENDER’]];</php></b></td>

                  </tr>

                  <tr>

                    <td bgcolor=”#eeeeee”><sup>*</sup>手机号码</td>

                    <td bgcolor=”#fbfbfb”><b>{$info.TELEPHONE}</b></td>

                    <td bgcolor=”#eeeeee”>电子邮箱</td>

                    <td colspan=”3″ bgcolor=”#fbfbfb”><b>{$member.EMAIL}</b></td>

                  </tr>

                  <tr>

                    <td colspan=”2″ bgcolor=”#eeeeee”><sup>*</sup>有效证件(身份证)</td>

                    <td colspan=”4″ bgcolor=”#fbfbfb”><b>{$info.IDS}</b></td>

                  </tr>

                  <tr>

                    <td bgcolor=”#eeeeee”>通讯地址</td>

                    <td colspan=”3″ bgcolor=”#fbfbfb”><b>{$info.ADDRESS}</b></td>

                    <td bgcolor=”#eeeeee”>邮编</td>

                    <td bgcolor=”#fbfbfb”><b>{$info.ZIPS}</b></td>

                  </tr>

                </table>

    </div> 

     

    </div> 

     

    静下心来,循序渐进。

  • 风儿吹来 是我和天空的对白,六一儿童节快乐~

    不让关爱和帮助我的人失望。

    六一儿童节快乐~ 保持一颗好奇之心,童真之心~

  • html5 网页视频播放器 video.js 与 OSM Player

    之前是galen跟我说的video.js播放器,我用的是video.js。后期设计播放修改后,GJ同事用了一个新的播放器,很好奇,故总结下。嗯,貌似记得很久以前前端设计师还是沈阳设计师群里有人问过类似幻灯片缩略焦点图那种可以播放器。其实 OSM Player就是这种啊~ ~ ~

    1、Video.js 是一个通用的在网页上嵌入视频播放器的 JS 库,Video.js 自动检测浏览器对 HTML5 的支持情况,如果不支持 HTML5 则自动使用 Flash 播放器。

     

    视频格式兼容性比较好的视频格式是 mp4  视频编码:AVC(H264)

    Writing library                  : x264 core 116 r2019 9cc407d        

    官网有点改变哦,点击播放按钮上移到左上角了。还好我前段时间下载的时候还在正中间。(⊙o⊙) 自我感觉旧有的在中间的好。 

    旧有demo下载

    官网:http://www.videojs.com/

    2、OSM Player是一个基于jQuery开发、开源的HTML5多媒体播放器。当浏览器不支持HTML5时,可以转成Flash。提供播放列表,播放列表可以隐藏,支持视频全屏播放。

    官网http://mediafront.org/osmplayer/

    后记:这俩的视频编码都是

    mp4  视频编码:AVC(H264)

  • 山川共澄澈,光彩交凌乱。

    卷862_1 【同沈恭子游虎丘寺有作】

    清远道士

    我本长殷周,遭罹历秦汉。

    四渎与五岳,名山尽幽窜。

    及此寰区中,始有近峰玩。

    近峰何郁郁,平湖渺弥漫。

    吟俯川之阴,步上山之岸。

    山川共澄澈,光彩交凌乱。

    白云蓊欲归,青松忽消半。

    客去川岛静,人来山鸟散。

    谷深中见日,崖幽晓非旦。

    闻子盛游遨,风流足词翰。

    嘉兹好松石,一言常累叹。

    勿谓余鬼神,忻君共幽赞。

    卷152_9 【刻清远道士诗,因而继作】

    颜真卿

    不到东西寺,于今五十春。

    朅来从旧赏,林壑宛相亲。

    吴子多藏日,秦王厌胜辰。

    剑池穿万仞,盘石坐千人。

    金气腾为虎,琴台化若神。

    登坛仰生一,舍宅叹珣珉。

    中岭分双树,回峦绝四邻。

    窥临江海接,崇饰四时新。

    客有神仙者,于兹雅丽陈。

    名高清远峡,文聚斗牛津。

    迹异心宁间,声同质岂均。

    悠然千载后,知我揖光尘。

  • 等比例缩放图片js

    转载自 http://www.qianyunlai.com/blog/397.html

    
    
    
    
    最新javascript自动按比例显示图片,按比例压缩图片显示
    
    
    
    
    原图显示(534 X 800)
    onload="AutoResizeImage(0,0,this)
    534 X 800

    1.按宽度250压缩,不限制高度 按比例压缩
    onload="AutoResizeImage(250,0,this)"
    250 X 374

    2.按高度250压缩,不限制宽度 按比例压缩
    onload="AutoResizeImage(0,250,this)"
    166 X 250

    3.按高度250宽度250 按比例压缩
    onload="AutoResizeImage(250,250,this)"
    200 X 300

    4.高宽不等比例压缩 (400 X 512),此时高度不变,会自动按高度的比例压缩。
    onload="AutoResizeImage(400,512,this)"
    341 X 512

    5.高宽不等比例压缩 (300 X 600),此时宽度不变,会自动按宽度的比例压缩。
    onload="AutoResizeImage(300,600,this)"
    300 X 449

    6.如果图片本来的高度和宽度小于压缩的最大高度和宽度,则不会拉大显示图片(按原图显示)
    原图444 x 207,压缩为 500 x 600,将保持原图显示
    onload="AutoResizeImage(500,600,this)"
    444 X 207

    效果图:

  • 脆弱的偏执

    静静吧~ 少年

    在他近乎神经质般的坚持下,释放出一种舍我其谁,势不可挡的光芒。

    其实,在坚持的背后,是一种,脆弱的,静止的,稍稍一碰触,就迸裂开来,全部崩塌,均匀爆裂的碎片。

    所有迸裂的碎片包裹着他颤抖自卑微弱倔强的心。

  • 这是一个柳絮花粉过敏,夏天已到的季节

    树叶已经长得像手掌那么大小了。风一吹,哗啦啦 哗啦啦。

    在睡梦中走进了花圃,醒来后,闻到了一身的花香。

    生活如湍流中的沙子,被河水裹挟而去。

    裙角飞扬

    有的时候,会拉住自己,翘足探望,这是哪里,伸出手,能否触摸到除了空气以外的东西。

    有的时候,捂住耳朵,跟着河流四处游荡,还会在心里祈祷,快些快些再快些吧,埋头闭眼追求飞翔的速度。

    有的时候,会回首看看那些日渐远去的河岸,那里曾有一只雀儿,那里曾有一朵花,那里还有一个垂钓的人。

    昨天和舍友,在上地公园玩,看到有附近中学的几个男孩子在跳街舞,周边也有人在学着。转角处,有好多老年人一对对的在跳交谊舞。突然坐在小湖边的石凳子上就不想走了。这场景多么像曾经以前的大学校园啊。

    那里的琴湖,剑湖蛟龙湖,是否还存在呢?

    希望晚上还有时间和心情待续。

  • wampserver怎么让他人访问以及删除后再次安装无法访问的问题

    以前安装,wampserve的时候直接就很顺利,没有出现的问题。(安装http://hi.baidu.com/constraint19/item/31e4f6e9903607c6baf37d33)

    这次安装wampserver的时候,卸载过一次,又重新安装,就出现错误。切换到在线状态也不能访问。出现几个问题,特整理一下,有遇到同类问题的可以看下。

    1、卸载软件后,再次安装wampserver,会切换到在线,不能访问到www文件目录,不能访问test.php

    解决:需要重新卸载,然后强力清扫下注册表。然后重启 端口号是不是修改和iis冲突

    2、安装成功后,自己能访问别人的ip 但是同一局域网的不能访问我的个人网站。

    解决:检查用别人电脑,ping自己的ip,如果不通。检查自己的防火墙端口,或者自己退出防火墙之类软件。就能解决。还有一种解决方法,我是从网络上搜索到得

    打开路径:X:wampbinapacheapache2.2.8conf

    其中X为您WAMP软件安装的磁盘路径,编辑httpd.conf文件,搜索 Allow from(在234行),

    将默认的“Allow from 127.0.0.1”修改为“Allow from all”,保存退出。

    也修改一下phpmyadmin让外部也可以访问,打开路径:X:wampalias 其中X为您安装WAMP软件的磁盘路径,
    编辑phpmyadmin.conf 配置文件,找到最后面一行的:Allow from 127.0.0.1

    同样是修改为:Allow from all

    完成修改后,保存退出,重新启动WAMP,或直接在软件单击左键>>>选择重新启动所有服务

    重新启动服务后,局域网内的机器在浏览器地址栏输入安装有WAMP软件的机器的IP 地址就可以访问了

    外网访问114.249.227.*:8080/

    在外网访问就要用到外网的IP,你可以在本地打开  www.ip.cn看下你的外网IP,得到IP后,外网用户就可以通过  http://外网IP/
        这样就可以访问了(如果你的apache是80端口),如果不是80端口,就要这样访问 http://外网IP:端口号/    这样访问  
    如 http://13.29.23.11:8080/ 

  • JQuery设置cookie|JQuery删除cookie|JQuery获取cookie 过期

    简单使用方法:

    1. <html>  
    2.    <head>  
    3.      <title>JQuery-Cookie插件</title>  
    4.      <script type="text/javascript" src="jquery-1.4.js"></script>  
    5.      <script type="text/javascript" src="jquery.cookie.js"></script>  
    6.    </head>  
    7.    <body>  
    8.      <a href="#">设置cookie1</a><br>  
    9.      <a href="#">设置cookie2</a><br>  
    10.      <a href="#">获取cookie</a><br>  
    11.      <a href="#">删除cookie</a><br>  
    12.    </body>  
    13. </html>  
    14. <script type="text/javascript">  
    15. $(function(){  
    16.      var COOKIE_NAME = ‘test_cookie’;  
    17.      //设置cookie,通过时间间隔  
    18.      $(‘a’).eq(0).click(function() {  
    19.          $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: 1 });  
    20.          return false;  
    21.      });  
    22.      // 设置cookie,到期时间  
    23.      $(‘a’).eq(1).click(function() {  
    24.          var date = new Date();  
    25.          date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000));  
    26.          $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: date });  
    27.          return false;  
    28.      });  
    29.      // 获取 cookie  
    30.      $(‘a’).eq(2).click(function() {  
    31.          alert($.cookie(COOKIE_NAME));  
    32.          return false;  
    33.      });  
    34.      // 删除cookie  
    35.      $(‘a’).eq(3).click(function() {  
    36.          $.cookie(COOKIE_NAME, null, { path: ‘/’ });  
    37.          return false;  
    38.      });  
    39. });  
    40. </script>

    插件的源代码也很简单:

    1. jQuery.cookie = function(name, value, options) {  
    2.      if (typeof value != ‘undefined’) { // name and value given, set cookie
    3.           options = options || {};  
    4.          if (value === null) {  
    5.               value = ”;  
    6.               options.expires = -1;  
    7.           }  
    8.          var expires = ”;  
    9.          if (options.expires && (typeof options.expires == ‘number’ || options.expires.toUTCString)) {  
    10.              var date;  
    11.              if (typeof options.expires == ‘number’) {  
    12.                   date = new Date();  
    13.                   date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));  
    14.               } else {  
    15.                   date = options.expires;  
    16.               }  
    17.               expires = ‘; expires=’ + date.toUTCString();  
    18.           }  
    19.          var path = options.path ? ‘; path=’ + (options.path) : ”;  
    20.          var domain = options.domain ? ‘; domain=’ + (options.domain) : ”;  
    21.          var secure = options.secure ? ‘; secure’ : ”;  
    22.           document.cookie = [name, ‘=’, encodeURIComponent(value), expires, path, domain, secure].join(”);  
    23.       } else {  
    24.          var cookieValue = null;  
    25.          if (document.cookie && document.cookie != ”) {  
    26.              var cookies = document.cookie.split(‘;’);  
    27.              for (var i = 0; i < cookies.length; i++) {  
    28.                  var cookie = jQuery.trim(cookies[i]);  
    29.                  if (cookie.substring(0, name.length + 1) == (name + ‘=’)) {  
    30.                       cookieValue = decodeURIComponent(cookie.substring(name.length + 1));  
    31.                      break;  
    32.                   }  
    33.               }  
    34.           }  
    35.          return cookieValue;  
    36.       }  
    37. };

    jQuery.cookie = function(name, value, options) {
        if (typeof value != ‘undefined’) { // name and value given, set cookie
            options = options || {};
            if (value === null) {
                value = ”;
                options = $.extend({}, options); // clone object since it’s unexpected behavior if the expired property were changed
                options.expires = -1;
            }
            var expires = ”;
            if (options.expires && (typeof options.expires == ‘number’ || options.expires.toUTCString)) {
                var date;
                if (typeof options.expires == ‘number’) {
                    date = new Date();
                    date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
                } else {
                    date = options.expires;
                }
                expires = ‘; expires=’ + date.toUTCString(); // use expires attribute, max-age is not supported by IE
            }
            // NOTE Needed to parenthesize options.path and options.domain
            // in the following expressions, otherwise they evaluate to undefined
            // in the packed version for some reason…
            var path = options.path ? ‘; path=’ + (options.path) : ”;
            var domain = options.domain ? ‘; domain=’ + (options.domain) : ”;
            var secure = options.secure ? ‘; secure’ : ”;
            document.cookie = [name, ‘=’, encodeURIComponent(value), expires, path, domain, secure].join(”);
        } else { // only name given, get cookie
            var cookieValue = null;
            if (document.cookie && document.cookie != ”) {
                var cookies = document.cookie.split(‘;’);
                for (var i = 0; i < cookies.length; i++) {
                    var cookie = jQuery.trim(cookies[i]);
                    // Does this cookie string begin with the name we want?
                    if (cookie.substring(0, name.length + 1) == (name + ‘=’)) {
                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                        break;
                    }
                }
            }
            return cookieValue;
        }
    };

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html lang="en">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <meta http-equiv="Content-Style-Type" content="text/css">
            <meta http-equiv="Content-Script-Type" content="text/javascript">
            <title>jQuery Cookie Plugin</title>
            <script src="../../scripts/jquery-1.3.1.js" type="text/javascript"></script>
            <script src="../../scripts/jquery.cookie.js" type="text/javascript"></script>
            <script type="text/javascript">
                $(function() {
                    var COOKIE_NAME = ‘test_cookie’;
                    var ADDITIONAL_COOKIE_NAME = ‘additional’;
                    $(‘a’).eq(0).click(function() { // 用天数设置 cookie
                        $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: 10 });
                        return false;
                    });
                    $(‘a’).eq(1).click(function() { // 用日期设置 cookie
                        var date = new Date();
                        date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
                        $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: date });
                        return false;
                    });
                    $(‘a’).eq(2).click(function() { // 获取 cookie
                        alert($.cookie(COOKIE_NAME));
                        return false;
                    });
                    $(‘a’).eq(3).click(function() { // 删除 cookie
                        $.cookie(COOKIE_NAME, null, { path: ‘/’ });
                        return false;
               &
    nbsp;    });
                    $(‘a’).eq(4).click(function() { // 设置第二个 cookie
                        $.cookie(ADDITIONAL_COOKIE_NAME, ‘foo’, { expires: 10 });
                        return false;
                    });
                    $(‘a’).eq(5).click(function() { // 获取第二个 cookie
                        alert($.cookie(ADDITIONAL_COOKIE_NAME));
                        return false;
                    });
                    $(‘a’).eq(6).click(function() { // 删除第二个 cookie
                        $.cookie(ADDITIONAL_COOKIE_NAME, null);
                        return false;
                    });
                });
            </script>
        </head>
        <body>
            <p>
                <a href="#">设置 cookie (设置有效期天数为 10 天)</a><br>
                <a href="#">设置 cookie (通过 date 对象设置过期日期为 3 天后的那天)</a><br>
                <a href="#">获取 cookie</a><br>
                <a href="#">删除 cookie</a><br>
                <a href="#">设置另一个 cookie</a><br>
                <a href="#">获取另一个 cookie</a><br>
                <a href="#">删除另一个 cookie</a>
            </p>
        </body>
    </html>

  • JQuery设置cookie|JQuery删除cookie|JQuery获取cookie 过期

    简单使用方法:

    1. <html>  
    2.    <head>  
    3.      <title>JQuery-Cookie插件</title>  
    4.      <script type="text/javascript" src="jquery-1.4.js"></script>  
    5.      <script type="text/javascript" src="jquery.cookie.js"></script>  
    6.    </head>  
    7.    <body>  
    8.      <a href="#">设置cookie1</a><br>  
    9.      <a href="#">设置cookie2</a><br>  
    10.      <a href="#">获取cookie</a><br>  
    11.      <a href="#">删除cookie</a><br>  
    12.    </body>  
    13. </html>  
    14. <script type="text/javascript">  
    15. $(function(){  
    16.      var COOKIE_NAME = ‘test_cookie’;  
    17.      //设置cookie,通过时间间隔  
    18.      $(‘a’).eq(0).click(function() {  
    19.          $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: 1 });  
    20.          return false;  
    21.      });  
    22.      // 设置cookie,到期时间  
    23.      $(‘a’).eq(1).click(function() {  
    24.          var date = new Date();  
    25.          date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000));  
    26.          $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: date });  
    27.          return false;  
    28.      });  
    29.      // 获取 cookie  
    30.      $(‘a’).eq(2).click(function() {  
    31.          alert($.cookie(COOKIE_NAME));  
    32.          return false;  
    33.      });  
    34.      // 删除cookie  
    35.      $(‘a’).eq(3).click(function() {  
    36.          $.cookie(COOKIE_NAME, null, { path: ‘/’ });  
    37.          return false;  
    38.      });  
    39. });  
    40. </script>

    插件的源代码也很简单:

    1. jQuery.cookie = function(name, value, options) {  
    2.      if (typeof value != ‘undefined’) { // name and value given, set cookie
    3.           options = options || {};  
    4.          if (value === null) {  
    5.               value = ”;  
    6.               options.expires = -1;  
    7.           }  
    8.          var expires = ”;  
    9.          if (options.expires && (typeof options.expires == ‘number’ || options.expires.toUTCString)) {  
    10.              var date;  
    11.              if (typeof options.expires == ‘number’) {  
    12.                   date = new Date();  
    13.                   date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));  
    14.               } else {  
    15.                   date = options.expires;  
    16.               }  
    17.               expires = ‘; expires=’ + date.toUTCString();  
    18.           }  
    19.          var path = options.path ? ‘; path=’ + (options.path) : ”;  
    20.          var domain = options.domain ? ‘; domain=’ + (options.domain) : ”;  
    21.          var secure = options.secure ? ‘; secure’ : ”;  
    22.           document.cookie = [name, ‘=’, encodeURIComponent(value), expires, path, domain, secure].join(”);  
    23.       } else {  
    24.          var cookieValue = null;  
    25.          if (document.cookie && document.cookie != ”) {  
    26.              var cookies = document.cookie.split(‘;’);  
    27.              for (var i = 0; i < cookies.length; i++) {  
    28.                  var cookie = jQuery.trim(cookies[i]);  
    29.                  if (cookie.substring(0, name.length + 1) == (name + ‘=’)) {  
    30.                       cookieValue = decodeURIComponent(cookie.substring(name.length + 1));  
    31.                      break;  
    32.                   }  
    33.               }  
    34.           }  
    35.          return cookieValue;  
    36.       }  
    37. };

    jQuery.cookie = function(name, value, options) {
        if (typeof value != ‘undefined’) { // name and value given, set cookie
            options = options || {};
            if (value === null) {
                value = ”;
                options = $.extend({}, options); // clone object since it’s unexpected behavior if the expired property were changed
                options.expires = -1;
            }
            var expires = ”;
            if (options.expires && (typeof options.expires == ‘number’ || options.expires.toUTCString)) {
                var date;
                if (typeof options.expires == ‘number’) {
                    date = new Date();
                    date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
                } else {
                    date = options.expires;
                }
                expires = ‘; expires=’ + date.toUTCString(); // use expires attribute, max-age is not supported by IE
            }
            // NOTE Needed to parenthesize options.path and options.domain
            // in the following expressions, otherwise they evaluate to undefined
            // in the packed version for some reason…
            var path = options.path ? ‘; path=’ + (options.path) : ”;
            var domain = options.domain ? ‘; domain=’ + (options.domain) : ”;
            var secure = options.secure ? ‘; secure’ : ”;
            document.cookie = [name, ‘=’, encodeURIComponent(value), expires, path, domain, secure].join(”);
        } else { // only name given, get cookie
            var cookieValue = null;
            if (document.cookie && document.cookie != ”) {
                var cookies = document.cookie.split(‘;’);
                for (var i = 0; i < cookies.length; i++) {
                    var cookie = jQuery.trim(cookies[i]);
                    // Does this cookie string begin with the name we want?
                    if (cookie.substring(0, name.length + 1) == (name + ‘=’)) {
                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                        break;
                    }
                }
            }
            return cookieValue;
        }
    };

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html lang="en">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <meta http-equiv="Content-Style-Type" content="text/css">
            <meta http-equiv="Content-Script-Type" content="text/javascript">
            <title>jQuery Cookie Plugin</title>
            <script src="../../scripts/jquery-1.3.1.js" type="text/javascript"></script>
            <script src="../../scripts/jquery.cookie.js" type="text/javascript"></script>
            <script type="text/javascript">
                $(function() {
                    var COOKIE_NAME = ‘test_cookie’;
                    var ADDITIONAL_COOKIE_NAME = ‘additional’;
                    $(‘a’).eq(0).click(function() { // 用天数设置 cookie
                        $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: 10 });
                        return false;
                    });
                    $(‘a’).eq(1).click(function() { // 用日期设置 cookie
                        var date = new Date();
                        date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
                        $.cookie(COOKIE_NAME, ‘test’, { path: ‘/’, expires: date });
                        return false;
                    });
                    $(‘a’).eq(2).click(function() { // 获取 cookie
                        alert($.cookie(COOKIE_NAME));
                        return false;
                    });
                    $(‘a’).eq(3).click(function() { // 删除 cookie
                        $.cookie(COOKIE_NAME, null, { path: ‘/’ });
                        return false;
               &
    nbsp;    });
                    $(‘a’).eq(4).click(function() { // 设置第二个 cookie
                        $.cookie(ADDITIONAL_COOKIE_NAME, ‘foo’, { expires: 10 });
                        return false;
                    });
                    $(‘a’).eq(5).click(function() { // 获取第二个 cookie
                        alert($.cookie(ADDITIONAL_COOKIE_NAME));
                        return false;
                    });
                    $(‘a’).eq(6).click(function() { // 删除第二个 cookie
                        $.cookie(ADDITIONAL_COOKIE_NAME, null);
                        return false;
                    });
                });
            </script>
        </head>
        <body>
            <p>
                <a href="#">设置 cookie (设置有效期天数为 10 天)</a><br>
                <a href="#">设置 cookie (通过 date 对象设置过期日期为 3 天后的那天)</a><br>
                <a href="#">获取 cookie</a><br>
                <a href="#">删除 cookie</a><br>
                <a href="#">设置另一个 cookie</a><br>
                <a href="#">获取另一个 cookie</a><br>
                <a href="#">删除另一个 cookie</a>
            </p>
        </body>
    </html>