I have the following code for my ad system:
function showandhide()
{
if ($('.showandhide').html() == 'show ads')
{
$('.showandhide').html("show ads");
$('.ads').hide();
}
else
{
$('.showandhide').html("hide ads");
$('.ads').show();
}
}
The code is very simple. It hides and shows ads in my website. The problem is that it does not store the user preferences. How do I store them? Is there a fast way without using a database? I do not feel like creating a code to store information to my database just for hiding and showing ads. Is there any other fast solutions? maybe something in jQuery?
If you are trying to store the detail temporarily you can save it in a session. for that you can use
jquery ajax..server side
ADDITION
in order to check if the session variable exists or not
check this link php Session_id_registered
and you want to save the session only when you click a button. you can give that by using jquery click event..
hope this helps!!