惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - Ame

将项目改为windows 服务的步骤 js 设为首页,加入收藏夹 - Ame - 博客园 压缩图片 - Ame - 博客园 FCKeditor 的使用心得 IE,firefox 里对浏览器事件处理的兼容性处理 - Ame - 博客园 项目中的JS ,alert 出现乱码 Jquery 插件参考 报表实现的参考 RDLC 矩阵使用 - Ame - 博客园 ajaxpro 的使用心得 - Ame - 博客园 [转]ReportViewer 2008的部署 Reporting services 权限 经典正则表达式 [转载] iframe和跨站点cookie被阻止 (转载) js 动态生成HTML,并加载事件遇到的问题 - Ame - 博客园 一些药物的副作用 一些食物的用法 Blogs Flog Fat 蜂蜜知识大全 - Ame - 博客园
jquery.cookies 的使用心得[仅做自己记忆所用]
Ame · 2009-09-02 · via 博客园 - Ame

http://plugins.jquery.com/files/jquery.cookie.js.txt
前段时间用 JQUERY COOKIE,做了一个购物车,在做的过程中,遇到一个问题,在不同页面存Cookie的时候,不是操作的同一个Cookie,以至于cookie里有两个相同的名的存在。
后解决是在每个cookie里加了过期时间和path .如:  $.cookie('Products', newcookies, { expires: 7, path: '/' });

问题就解决了。
得到cookie: var allcookies = $.cookie('Products');//Products 是cookie名

生成新的cookie:  var newcookies = "";
      if ($.cookie('Products') == null) {
        newcookies += commodityId + "|" + type + "=1";//给cookie赋相应的值
        $.cookie('Products', newcookies, { expires: 7, path: '/' });//重置名为product的cookie值
    }
清空的为:    $.cookie('Products', '', { expires: -1, path: '/' });