Create array in cookie with javascript

后端 未结 9 906
-上瘾入骨i
-上瘾入骨i 2020-12-08 10:32

Is it possible to create a cookie using arrays?

I would like to store a[0]=\'peter\', a[\'1\']=\'esther\', a[\'2\']=\'john\' i

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 11:07

    Create array in cookie using jQUery?

    var list = new cookieList("test"); $(img).one('click', function(i){ while($('.selected').length < 3) {
        $(this).parent()
            .addClass("selected")
            .append(setup.config.overlay);
    
        //$.cookie(setup.config.COOKIE_NAME, d, setup.config.OPTS);
        var index = $(this).parent().index();
    
        // suppose this array go into cookies.. but failed
        list.add( index );
    
        var count = 'You have selected : ' + $('.selected').length + ' deals';
        if( $('.total').length ){
            $('.total').html(count);
        }
    
    }  });
    

提交回复
热议问题