I have implemented a modal popup in sharepoint 2016 from a tutorial on another site with this code:
<script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', showModalPopUp);
});
function showModalPopUp() {
//Set options for Modal PopUp
var options = {
url: 'https://testurl.nl', //Set the url of the page
title: 'Testpopup', //Set the title for the pop up
allowMaximize: false,
showClose: true,
width: 600,
height: 400
};
//Invoke the modal dialog by passing in the options array variable
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
return false;
}
</script>
Now i need this popup to open once per user per day, or if that can't be done once per session. How do i do this using the code above?