如何通过单击<a tag=""> and assign that cookie value to php variable</a>更改jquery中的cookie值

时间:2013-08-21 12:47:01

标签: php jquery

jquery代码:

$("a").click(function(){
        var id = $(this).attr('id');
        if($.cookie('targetID') === null){              
            $.cookie('targetID',this.id);
            location.reload();  
        }else{
            $.removeCookie('targetID');
            $.cookie('targetID',this.id);
            location.reload();  
        }   
});

php代码:

$targetID = $this->input->cookie('targetID');

0 个答案:

没有答案
相关问题