Currently working on a JavaScript on a SharePoint home page.
The script below will popup a window that shows a message: "Welcome to new page."
However, it is going to be annoying if it appears every single time user go to the page.
Is there a way to show the popup only once for per user each session?
<script language="javascript" type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(yourFunction, 'SP.js');
function CloseCallback()
{
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.Cancel);
}
function yourFunction()
{ SP.UI.ModalDialog.showWaitScreenWithNoClose('Welcome to the new site');
setTimeout(function() { CloseCallback(); }, 2000); }
_spBodyOnLoadFunctionNames.push("yourFunction()"); </script>