Notification alert similar to how stackoverflow functions
Stack Overflow uses the jQuery framework, which has a method to show a hidden element using a simple animation, something like:
$('#notification-bar').show('slow');
http://api.jquery.com/show/ (check out the demos).
It is fixed to the top of the page using position:fixed
in CSS:
#notification-bar {
position:fixed;
top: 0px;
left: 0px;
width: 100%;
}
How to make a shiny or javascript alert that appears in front of other windows/apps
A better option is to use browser notification. This will trigger the browser to send out notifications in front of all windows and all other software programs. Plus, this works across all platforms, no matter what version of Windows or Linux or MacOS, as long as they have a modern browser, like Chrome, Firefox, Edge or others, it will work.
Here is how to do:
$( document ).ready(function() {
Shiny.addCustomMessageHandler('alert', function(data) {
Notification.requestPermission().then(function() {
new Notification(data.msg);
});
})
});
In your shiny server, after your process is done, add this
session$sendCustomMessage(
type = 'alert',
message = list(
msg = "my message"
)
)
Full code:
library(shiny)
ui <- fluidPage(
tags$script(
'
$( document ).ready(function() {
Shiny.addCustomMessageHandler(\'alert\', function(data) {
Notification.requestPermission().then(function() {
new Notification(data.msg);
});
})
});
'
)
)
server <- function(input, output, session) {
observe({
# do some thing
Sys.sleep(2)
session$sendCustomMessage(
type = 'alert',
message = list(
msg = "my message"
)
)
})
}
shinyApp(ui, server)
The first time, users will be asked for permission, once they have accepted, notifications will show.
When it is displayed on Linux, Windows maybe a little different, but still should be above all programs.
Get Alert Notification when azure function returns code 200
I want to get notification when my azure function returns status 200.
I have set up Alert and I am part of Action group that's supposed to
receive alert.
I tried to create an notification alert for my function . When run my function if it returns 200 OK
,then it send me an mail notification of it.
Here are steps:
- Created an function with http trigger and create alert from function app > Alert >Create alert and add condition and action group and email /phone details to receive an notification .
Here is the configurations based on your requirement
- Settings inside alert in action added function :
- Run my function app and returned 200 status:
Here is the email notifications:
For more information please refer this Blog & MS DOC .
How can i handle push notification in IMF8?
In the code snippet you have in your question there is an alert
. Remove the alert
snippet and no alert dialog will be displayed...
You can then put there instead anything else you'd like, like logging the notification contents, or performing any other action, like calling a function.
var notificationReceived = function(message) {
myFunction();
};
function myFunction() {
...
}
Related Topics
Download Attribute Not Working in Firefox
Using JavaScript to Override or Disable Meta Refresh Tag
JavaScript Show Element on Click
Get the Height of an Element Minus Padding, Margin, Border Widths
Canvas.Todataurl() Security Error the Operation Is Insecure
How to Dynamically Adjust CSS Stylesheet Based on Browser Width
Set the Default Save as Name for a an <Embed> or <Iframe> That Uses a Blob
Bootstrap 3 Accordion Collapse Does Not Work on Iphone
Google Maps Marker - Set Background Color
Using Media Queries to Only Include Js Files on Mobile
How to Have Select Filter in Ngtable
Notification Alert Similar to How Stackoverflow Functions
Fontawesome Fails to Load Fonts Locally and in Electron App
How to Apply Title Case in Input Box Through CSS
Determine the Width of a Dynamic CSS3 Multicolumn Div Width Fixed Column-Width
How to Workaround: IE6 Does Not Support CSS "Attribute" Selectors