There is a browsing page (index.html) similar to the following
<!doctype html>
<html>
<head>
<metacharset="utf-8"/>
<meta name="viewport" content="width=device-width, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<title>Notification</title>
</head>
<body>
<script src='https://cdn.rawgit.com/jaredreich/notie.js/a9e4afbeea979c0e6ee50aaf5cb4ee80e65d225d/notie.js'></script>
<script>
window.onload=function(){
notie.alert(1, 'Notification', 10);
};
</script>
</body>
</html>
The following methods for displaying notifications now run when the page is loaded:
Is it possible to call this from another administrative page (for example, admin.html) at any time?
<script>
window.onload=function(){
notie.alert(1, 'Notification', 10);
};
</script>
You can call an iframe referencing index.html at any time.
↓ This image calls the following functions at any time.
function call_it(){
$("<iframe src='index.html'/>").appendTo("body");
}
Roughly speaking,
Admin.html sends a request from admin.html to "notify the user" to the server by some means as user authenticated.
The server maintains a "Need to Notify" state in the above request.
The server pushes the notification to the browser.Really push with WebSocket, pseudo push with HTTP polling, etc.
922 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
576 Who developed the "avformat-59.dll" that comes with FFmpeg?
623 Uncaught (inpromise) Error on Electron: An object could not be cloned
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.