Created
April 16, 2018 07:11
-
-
Save beinoriusju/461aace729ea44350004d133f28bce02 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
var AGE_RESTRICTION_SESSION_KEY = '{{session_redirect}}'; | |
window.addEventListener('load', function(){ | |
$(document.getElementById('age-restriction-modal')).modal({backdrop: "static"}); | |
document.getElementById('age-negative').addEventListener('click', function(){ | |
window.location = "{{redirect_url}}"; | |
}); | |
document.getElementById('age-positive').addEventListener('click', function(){ | |
$.post(AGE_RESTRICTION_SESSION_KEY, { age: {{age}} }, function(response){ | |
if (JSON.parse(response).success != 1) { | |
console.log('Session Error. Check your cookie!'); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment