Created
February 7, 2014 04:32
-
-
Save mdsahib/8857402 to your computer and use it in GitHub Desktop.
Usage of localstorage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.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