我无法存储会话...
我正在使用的代码:
//save to session
$.session("compareLeftContent","value");
alert($.session("compareLeftContent"));
请问有什么想法吗?
我无法存储会话...
我正在使用的代码:
//save to session
$.session("compareLeftContent","value");
alert($.session("compareLeftContent"));
请问有什么想法吗?
在您提供的 jsfiddle 示例中,没有附加会话插件。$.session
不包含在 jQuery 中。您需要使用此插件才能拥有此功能:Jquery Session Plugin
然后使用$.session.set
和$.session.get
方法来存储和读取会话密钥。
例子:
$.session.set("compareLeftContent","value");
alert($.session.get("compareLeftContent"));
你在使用 session.js 吗?
您需要使用以下方式设置会话$.session.set
:
$.session.set("compareLeftContent", "value");
要检索会话值,请使用$.session.get
:
alert($.session.get("compareLeftContent"));