Created
November 27, 2019 04:02
-
-
Save rileyrichter/61b1665998c7d3a0b315fcfeee1c40bd to your computer and use it in GitHub Desktop.
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
<script> | |
function myVote(shortcode) { | |
$(document).on('submit', 'form', function() { | |
// Set product in local storage | |
localStorage.setItem(shortcode, "true"); | |
// Refresh page after 3000 milliseconds | |
setTimeout(function() { location.reload(true); }, 3000); | |
}); | |
}; | |
</script> | |
<script> | |
const allthethings = []; | |
for(let i=0; i<localStorage.length; i++) { | |
let key = localStorage.key(i); | |
allthethings.push(localStorage.key(i)); | |
document.getElementById(localStorage.key(i)).style.display = "none"; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment