“Push Notification JavaScript” Kode Jawaban

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');
          };
         }
        }
faheem

Data mengirimkan pemberitahuan dalam JavaScript

  <script src="http://www.jqueryscript.net/demo/Sliding-Growl-Notification-Plugin-For-jQuery-jsnotify/dist/js/notify.js"></script>
  <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  <link href="http://www.jqueryscript.net/demo/Sliding-Growl-Notification-Plugin-For-jQuery-jsnotify/dist/css/notify.css" rel="stylesheet"/>
  <link href="http://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css" rel="stylesheet"/>
  
  
  <form action="" method="post" id="myDiv">
  <input type="text" name="name" id="n1">
  <input type="text" name="mobile" id="n2">
  <input type="submit" name="submit" value="click me">
  </form>
Doubtful Donkey

Jawaban yang mirip dengan “Push Notification JavaScript”

Pertanyaan yang mirip dengan “Push Notification JavaScript”

Lebih banyak jawaban terkait untuk “Push Notification JavaScript” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya