开发者

JQuery treeview plugin cookie path

开发者 https://www.devze.com 2022-12-22 22:01 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号