WF8266R-93980018.html 注意:線上實作平台僅供練習, 程式請自行下載留存, 不定期會清空

<!doctype html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <title>WF8266R.js IR Read</title>

    <!-- Imports WF8266R -->
    <script src="http://wf8266.com/wf8266r/webcomponent/jquery-2.1.4.min.js"></script>
    <script src="http://wf8266.com/wf8266r/webcomponent/wf8266r/wf8266r.js"></script>
    <link href="http://wf8266.com/wf8266r/webcomponent/wf8266r/wf8266r.css" rel="stylesheet" />

    <script>
        document.addEventListener('wf8266r-ready', function (e) {

        },false);

        $(function () {
            //載入 WF8266R 元件
            GPIO.init();
            setInterval(function(){
                GPIO.irCode(14, function(ir){
                     $("#codeType").text(ir.type);
                     $("#code").text(ir.code);
                     $("#logo").html("<span>"+ir.code+"</span><br /><br />"+ $("#logo").html());
                });
            },1000); 
        });
    </script>

</head>
<body>
    <unu-wf8266r ip="mywfXXXX.local" uuid="xxxx" device="xxxx"></unu-wf8266r>
    型別 : <span id="codeType"></span><br /><br />
    編碼 : <span id="code"></span><br /><br />    
    Log : <div id="logo"></div>
</body>
</html>

請按 RUN 執行