Using cookies makes Sortable crash

Using cookies makes Sortable crash

Hi.

I'm using UI and sortable, and am now trying to use cookies to remember which pages are visible and not.

I am using the following code:

  1.     $('.expand').click(function()
        {
            var parentId = $(this).parent().attr("id");
            var parentId = parentId.replace("page", "parent");

            if ($('#' + parentId).is(":visible"))
            {
                $('#' + parentId).slideUp("fast", function()
                {
                    $('#expand-' + parentId).attr("src", "images/sortable-expand.gif");
                    $.cookie("this-is-a-test","this-is-a-test");
                });
            }
           
            else
            {
                $('#' + parentId).slideDown("fast", function()
                {
                    $('#expand-' + parentId).attr("src", "images/sortable-expand2.gif");
                });
            }       
        });






















The problem appears when the expand-click-function fires the first time. The function completes with success, but when I'm trying to expand/collapse another UL, it all hangs. When removing the $.cookie, it all works fine.

Any clue to why setting a cookie makes it all stop working?









    • Topic Participants

    • audun