久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='7Q609'></tfoot>

        <bdo id='7Q609'></bdo><ul id='7Q609'></ul>

      1. <i id='7Q609'><tr id='7Q609'><dt id='7Q609'><q id='7Q609'><span id='7Q609'><b id='7Q609'><form id='7Q609'><ins id='7Q609'></ins><ul id='7Q609'></ul><sub id='7Q609'></sub></form><legend id='7Q609'></legend><bdo id='7Q609'><pre id='7Q609'><center id='7Q609'></center></pre></bdo></b><th id='7Q609'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7Q609'><tfoot id='7Q609'></tfoot><dl id='7Q609'><fieldset id='7Q609'></fieldset></dl></div>
      2. <small id='7Q609'></small><noframes id='7Q609'>

        <legend id='7Q609'><style id='7Q609'><dir id='7Q609'><q id='7Q609'></q></dir></style></legend>

        等待 document.body 存在

        Wait for document.body existence(等待 document.body 存在)
        <i id='eC4xg'><tr id='eC4xg'><dt id='eC4xg'><q id='eC4xg'><span id='eC4xg'><b id='eC4xg'><form id='eC4xg'><ins id='eC4xg'></ins><ul id='eC4xg'></ul><sub id='eC4xg'></sub></form><legend id='eC4xg'></legend><bdo id='eC4xg'><pre id='eC4xg'><center id='eC4xg'></center></pre></bdo></b><th id='eC4xg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eC4xg'><tfoot id='eC4xg'></tfoot><dl id='eC4xg'><fieldset id='eC4xg'></fieldset></dl></div>
        <tfoot id='eC4xg'></tfoot>
          <tbody id='eC4xg'></tbody>

            1. <small id='eC4xg'></small><noframes id='eC4xg'>

                • <bdo id='eC4xg'></bdo><ul id='eC4xg'></ul>
                • <legend id='eC4xg'><style id='eC4xg'><dir id='eC4xg'><q id='eC4xg'></q></dir></style></legend>
                • 本文介紹了等待 document.body 存在的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我編寫了一個 Chrome 擴展程序,可以在頁面加載之前運行(使用屬性 run_at":document_start").問題是我想在創建后立即將 div 標記添加到網頁正文.在那之前 document.body 是空的,所以我不能給它附加標簽.

                  I wrote a Chrome extension that works before the page is loaded (using the attribute "run_at": "document_start"). The problem is that I want to add a div tag to the web page body as soon as it is created. Before that document.body is null so I can't append tags to it.

                  我不在乎身體的滿負荷,我只需要它存在.

                  I don't care about full load of the body, I just need it to be existent.

                  我正在嘗試找到在創建 html 中的 body 標記(未完全加載,只是創建)時發出警報的最佳方法.我可以為這種情況編寫任何事件處理程序嗎?

                  I am trying to find the best way to be alerted when the body tag in html is created (not loaded fully, just created). Is there any event handler for this case that I can write?

                  另外,我不想使用 jQuery 或任何其他非內置庫.

                  Also, I don't want to use jQuery or any other non built-in library.

                  推薦答案

                  你可以使用 document.documentElement 上的 ">mutation observer 監聽對其 childList 的更改并查看添加的內容是否為 body.

                  You could use a mutation observer on document.documentElement listening for changes to its childList and looking to see whether the thing that got added is body.

                  示例:Live Copy

                  <!DOCTYPE html>
                  <html>
                  <head>
                    <meta charset="utf-8">
                    <title>Example</title>
                    <script>
                      (function() {
                        "use strict";
                  
                        var observer = new MutationObserver(function() {
                          if (document.body) {
                            // It exists now
                            document.body.insertAdjacentHTML(
                              "beforeend",
                              "<div>Found <code>body</code></div>"
                            );
                            observer.disconnect();
                          }
                        });
                        observer.observe(document.documentElement, {childList: true});
                      })();
                    </script>
                  </head>
                  <body>
                    <div id="foo"></div>
                  </body>
                  </html>
                  

                  這篇關于等待 document.body 存在的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                    <legend id='5kxxu'><style id='5kxxu'><dir id='5kxxu'><q id='5kxxu'></q></dir></style></legend>

                    <small id='5kxxu'></small><noframes id='5kxxu'>

                      1. <tfoot id='5kxxu'></tfoot>
                      2. <i id='5kxxu'><tr id='5kxxu'><dt id='5kxxu'><q id='5kxxu'><span id='5kxxu'><b id='5kxxu'><form id='5kxxu'><ins id='5kxxu'></ins><ul id='5kxxu'></ul><sub id='5kxxu'></sub></form><legend id='5kxxu'></legend><bdo id='5kxxu'><pre id='5kxxu'><center id='5kxxu'></center></pre></bdo></b><th id='5kxxu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5kxxu'><tfoot id='5kxxu'></tfoot><dl id='5kxxu'><fieldset id='5kxxu'></fieldset></dl></div>
                          • <bdo id='5kxxu'></bdo><ul id='5kxxu'></ul>

                              <tbody id='5kxxu'></tbody>
                            主站蜘蛛池模板: 国产精品毛片一区二区在线看 | 欧美日韩福利视频 | 羞羞视频一区二区 | 久久爱黑人激情av摘花 | 日韩欧美高清 | 鸳鸯谱在线观看高清 | 日日骚av| 中文字幕在线欧美 | 天堂色 | 在线国产一区二区 | 2018国产精品 | 一二区视频 | 国产精品美女久久久久久免费 | 久久久久国产一级毛片 | 免费午夜视频在线观看 | 精品美女在线观看视频在线观看 | 日韩国产在线 | 欧美高清视频在线观看 | 国产高清免费视频 | av在线视| 欧美激情视频一区二区三区在线播放 | 在线中文字幕国产 | 欧美福利久久 | 久婷婷 | 亚洲精品欧美一区二区三区 | 91精品国产91久久综合桃花 | 日韩欧美专区 | 国产精品欧美一区二区三区 | 欧美精品一区二区在线观看 | 男人天堂网址 | 久久精品网 | 亚洲精品在线视频 | 日本免费一区二区三区 | 国产精品美女久久久久久免费 | 国产综合精品一区二区三区 | 欧美国产亚洲一区二区 | 欧美中文字幕 | 国产精彩视频在线观看 | 亚洲视频三区 | 精品国产乱码久久久久久闺蜜 | 日日做夜夜爽毛片麻豆 |