18. System Information APISystem Information API
システム情報システム情報
navigator.system.monitor("Thermal", success);
function success(thermal) {
// thermal オブジェクト :
// thermal.state = 気温
}
19. WebSocket API, Server Sent EventsWebSocket API, Server Sent Events
ウェブソケット、サーバセントイベントウェブソケット、サーバセントイベント
caniuse.com/#feat=websocketscaniuse.com/#feat=websockets
20. WebSocket API, Server Sent EventsWebSocket API, Server Sent Events
ウェブソケット、サーバセントイベントウェブソケット、サーバセントイベント
// ウェブソケットの作成
var socket =
new WebSocket('ws://example.com/update');
socket.onopen = function () {
// 接続する時に実効するコード
setInterval(function() {
if (socket.bufferedAmount == 0)
socket.send(getUpdateData());
}, 50);
};