Skip to content

Instantly share code, notes, and snippets.

@beinoriusju
Created April 16, 2018 07:11
Show Gist options
  • Save beinoriusju/461aace729ea44350004d133f28bce02 to your computer and use it in GitHub Desktop.
Save beinoriusju/461aace729ea44350004d133f28bce02 to your computer and use it in GitHub Desktop.
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