久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      什么是Notifications?HTML5 Notifications桌面提醒

      Notifications是HTML5的一個(gè)新特性~ 可以看看360電腦搶票,也是用Notifications提示的~,下面小編寫了一個(gè)HTML5 Notifications桌面提醒,還是挺不錯(cuò)的哦!<!DOCTYPE html>

      <html>  <head>  <meta charset="utf-8">  <title>HTML5 - Notifications</title>  <script>  //判斷瀏覽器是否支持Notifications  function supported(){  	if(window.webkitNotifications){  		alert('瀏覽器支持Notifications');  	} else {  		alert('瀏覽器不支持Notifications');  	}  }    //請求桌面通知權(quán)限  function requestPermission() {  	window.webkitNotifications.requestPermission();  }    //獲取請求權(quán)限狀態(tài)  function checkPermission() {  	switch (window.webkitNotifications.checkPermission()) {  		case 0:alert('用戶已允許顯示桌面通知');break;  		case 1:alert('用戶還沒有允許或拒絕顯示桌面通知');break;  		case 2:alert('用戶已拒絕顯示桌面通知');break;  	}  }    //創(chuàng)建文本消息  function textMsg(){  	var icon = 'logo.png';  	var title = '阿鵬's BLOG';  	var body =  'http://www.1990c.com';  	var popup = window.webkitNotifications.createNotification(icon, title, body);    	popup.ondisplay = function(event) {  		setTimeout(function() {  			event.currentTarget.cancel();  		}, 5000);  	}    	popup.show();  }    //創(chuàng)建HTML消息  function htmlMsg(){  	var popup = window.webkitNotifications.createHTMLNotification('msg.html');    	popup.ondisplay = function(event) {  		setTimeout(function() {  			event.currentTarget.cancel();  		}, 5000);  	}    	popup.show();  }  </script>  </head>    <body>  <input type="button" value="是否支持桌面提醒" onclick="supported();"/>  <input type="button" value="請求權(quán)限" onclick="requestPermission();"/>  <input type="button" value="請求權(quán)限狀態(tài)" onclick="checkPermission();"/>  <input type="button" value="顯示文本消息" onclick="textMsg();"/>  <input type="button" value="顯示HTML消息" onclick="htmlMsg();"/>  </body>  </html>

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號