<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 事件探析 ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>test</title> <script src="https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1-cc52697ab1.10.2.js"></script> <style> .box { margin: 10px 0; background: red; height: 100px; } </style> </head> <body> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <script> boxs = document.getElementsByClassName('box'); var len = boxs.length; // 一:為什么這種循環綁定事件,最后彈出都是4 // for (var i = 0; i < len; i++) { // boxs[i].onclick = function() { // alert(i); // }; // } // 事件綁定還是和上面一樣,i 是局部變量了,但還是不符合我們常規理解預期的 // function test() { // for (var i = 0; i < len; i++) { // boxs[i].onclick = function () { // var i2 = i; // console.log(i2) // }; // } // } // test(); // function test() { // for (var i = 0; i < len; i++) { // $(boxs[i]).click(function() { // console.log(i); // }); // } // } // test(); // function test() { // $('.box').each(function(index, el) { // $(el).click(function() { // console.log(index); // }); // }); // } // test(); // function test() { // for (var i = 0; i < len; i++) { // (function () { // boxs[i].onclick = function () { // console.log(i) // }; // })(); // } // } // test(); function test() { for (var i = 0; i < len; i++) { setTimeout(function () { // Cannot set property 'onclick' of undefined // in boxs[4] undefined boxs[i].onclick = function () { console.log(i) }; }, 10); } } test(); </script> </body> </html> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看