I have the following script validation.php
<?php
if(!isset($_SESSION['userId'])){
session_destroy();
header('Location: home.php');
exit;
}
?>
I would like to execute this script every time someone clicks a button in the #main-display
$("#main-display").on('click', 'button', function (event){
//some code in here
});
How would I go about doing this?