Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用JQuery Cookie 插件计算用户访问我的网站的次数。设置读取 cookie 非常简单,没有问题,但我不太清楚每次用户返回时如何增加 cookie 的值。
function update_visit_count() { // Get the old visit count, or 0 if this is his first time var visits = $.cookie("visits") || 0; // Add 1 to it visits++; // Save the updated cookie $.cookie("visits", visits); }