Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

push notification javascript

function notifyMe(title,body) {
         if (Notification.permission !== 'granted'){
          Notification.requestPermission();
          alert('Allow Notification Please');
         }else {
          var notification = new Notification(title, {
           icon: '../assets/img/brand/logo.png',
           body: body,
           data: 'Nomad Chat',
           vibrate: [200, 100, 200]
          });
          notification.onclick = function() {
           window.open('chat.php');
          };
         }
        }
Comment

PREVIOUS NEXT
Code Example
Javascript :: write bytes64 in json python 
Javascript :: anchor element onclick not working 
Javascript :: remove specific property from json object javascript 
Javascript :: drupal 8 get url from node entity 
Javascript :: time calculator js 
Javascript :: mongoose custom object schema 
Javascript :: flask socketio example 
Javascript :: npm for node types 
Javascript :: how to loop through array of numbers in javascript 
Javascript :: read all file names of folder in react 
Javascript :: regex for company name 
Javascript :: how to make nextjs image component responsive 
Javascript :: difference between == and === in javascript 
Javascript :: add tailwind to create react app 
Javascript :: javascript math pi 
Javascript :: change value of drop down using jquery 
Javascript :: jquery select all except first child 
Javascript :: conditional object spread 
Javascript :: next js absolute path 
Javascript :: javascript run two functions at the same time 
Javascript :: vue.js textbox 
Javascript :: javascript sum array 
Javascript :: javascript trim 
Javascript :: dynamic copyright year js 
Javascript :: last element of array js 
Javascript :: jquery to br 
Javascript :: rename file in js 
Javascript :: how to move an element of an array in javascript 
Javascript :: nuxt router push 
Javascript :: jquery change input value if greater than 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =