Skip to content

Instantly share code, notes, and snippets.

@mdsahib
Created February 7, 2014 04:32
Show Gist options
  • Save mdsahib/8857402 to your computer and use it in GitHub Desktop.
Save mdsahib/8857402 to your computer and use it in GitHub Desktop.
Usage of localstorage
$('.buttonClass').click(fucntion(event){
var id = $(this).data('id');
if(isNotAlreadyClicked(id))
doSomething();
else doDifferentThing();
});
fucntion isNotAlreadeyClicked(id){
if(window.localstorage[id] === true)
return false;
else true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment