'How can I get modal dialog to pop up once per session using HTML SCRIPT Tag only?
How can I get this modal dialog to pop up once per browser session? Every time I refresh the homepage it pops up. I only want it to pop up once per browser session. I have to include this in the HTML script tags, there is no separate JS file. This is all inside of a PLSQL procedure using the "htp.print" command.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Dialog - Modal message</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
<script>
$( function ModalPopup() {
$( "#dialog-message" ).dialog({
modal: true,
width: 500,
buttons: {
OK: function ModalPopup() {
$( this ).dialog( "close" );
}
}
});
} );
</script>
</head>
<body>
<div id="dialog-message" title="Important Message">
<p><b>This is Protected system.</b><br><br>
<b>This system is for authorized users only.</b><br><br>
By accessing and using this information system, you acknowledge and consent to the following:<br><br>
• You are accessing classified information system (which includes any device attached to this information system) that is provided for authorized use only.<br>
• Unauthorized or improper use of this system and its contents may result in suspension or loss of access privileges, disciplinary action, and/or civil and/or criminal penalties.<br>
</p>
</div>
</body>
</html>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
