开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜