Hi all, I use the jquery.cookie plugin and I'm trying to remove rows when I click at a link.
The thing is, the content is database generated, so if it's 10 items in the database the NewsRows div renders 10 times. I can use the ID number to remove the rows, it works great, but what I need to do is to set every row I have removed from the click into a cookie. However I can set only one cookie per click, if I click at row number 99 (ID) this will be set in a cookie and if I reload the page the row 99 is gone. But.. If I now click att lets say row 56 - this new ID will be set in the cookie and the 99 have gone. In other word, how can I just add the new click ID number into the existing cookie?
This would be really great if some one could help me out here! Thanks in advance.
-- The markup --
<div class="NewsRow">
<a href="
#{@ID}" id="
{@ID}" name="
{@ID}">Hide</a>
<div class="NewsContentContainer">
<div class="NewsTitle
{@ID}">
<a href="#">Content..</span>
</div>
</div>
</div>
-- The jQuery --
jQuery(document).ready(function(){
var cookieName = 'Item-';
var Options = {expires: 7, path: '/'};
$(".container a").click(function(e){
var LinkID = $(this).attr('id');
$("." + LinkID).remove();
$.cookie(cookieName, LinkID, Options);
});
$("." + $.cookie(cookieName)).remove();
});