I have a problem adding a cookie. Read a couple of answers, but it's hard to understand if you've never worked with them.
Basically I want to add a cookie if someone clicked on the specified button. For example, if a person clicks the button "like a button", hidden content will be detected regardless of whether he will go forward / backward or refresh the page, and the cookie should be deleted after a couple of days.
What I used to hide the content is the following:
HTML:
<div id="fd">
<p>Button from below will become active once you hit like button!</p>
<div id="get-it">
<a class="button"><img src="img/get-button.png"></a>
</div>
</div>
<div id='feedback' style='display:none'></div>
JavaScript:
FB.Event.subscribe('edge.create', function (response) {
$('#feedback').fadeIn().html('<p>Thank you. You may proceed now!</p><br/><div id="get-it"><a class="button2" href="pick.html"><img src="img/get-button.png"></a></div>');
$('#fd').fadeOut();
});
However, if I click update or return to the content page, it will be hidden again. This is the reason I want to add a cookie when a button is clicked. Anyone who can give me some explanation or sample code? Thank.