JQuery treeview plugin cookie path
How do I set the cookie path
to "开发者_C百科/"
with the jQuery treeview plugin?
I just reset cookie. It does not need any patches for treeview plugin
$("#tree").treeview({
persist: "cookie",
toggle: function (args) {
// get cookie
cookieId = "MycookieId";
data = $.cookie(cookieId);
// remove cookie
$.cookie(cookieId, null);
// add with path
$.cookie(cookieId, data, { path: "/" });
}
});
hmm, I think its may be
$.cookie('key', 'value', { path : "/" } );
Should be easy to go , :)
Just use this:
$(document).ready(function(){
$("#red").treeview({
animated: "fast",
collapsed: true,
unique: true,
persist: "cookie",
});
});
It should be fine.
and this: jquery.cookie.js
精彩评论