3

我需要从通知窗口在页面上发送消息。怎么做我有以下页面


     var shownotif=0;         
    Set notification permissions for this page   Show HTML Notification    /*    * Common code    */   document.querySelector('#request_permission').addEventListener('click', function() {
    window.webkitNotifications.requestPermission();   }, false);
    // see the HTML section to see the button   var url = 'index212.html';   document.querySelector('#show_html_notification').addEventListener('click', function() {
    if (window.webkitNotifications.checkPermission() == 0) {
      // you can pass any url as a parameter
      notif=window.webkitNotifications.createHTMLNotification(url);
        notif.addEventListener('display', function() {
        ///alert(111);
      // notif.cancel();
        }
        );
         notif.addEventListener('click', function(g, g2) {
         setTimeout("tkfnm",1000);
        alert(jQuery.cookie("ca2"));
      // notif.cancel();
        }
        );
      notif.show(); // note the show()

    } else {
      alert("This page doesn't have permission to show notifications yet.");
    }   }, false);
         

我希望当用户点击通知窗口时,在“父母”上发送我的信息和我的信息。

4

0 回答 0