相关疑难解决方法(0)

如何在午夜使用Jquery使Cookie过期?

我这样做了:

$.cookie("ultOS", (i), {expires:1});
Run Code Online (Sandbox Code Playgroud)

但它只会在第二天到期.

我怎样才能在午夜过期?

这会改变吗?

var date = new Date();
var midnight = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
$.cookie("ultOS", (i), {expires: midnight});
Run Code Online (Sandbox Code Playgroud)

jquery jquery-plugins

8
推荐指数
1
解决办法
5838
查看次数

标签 统计

jquery ×1

jquery-plugins ×1