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

  1. <tfoot id='aeB0S'></tfoot>

    <legend id='aeB0S'><style id='aeB0S'><dir id='aeB0S'><q id='aeB0S'></q></dir></style></legend>

        <bdo id='aeB0S'></bdo><ul id='aeB0S'></ul>

      <small id='aeB0S'></small><noframes id='aeB0S'>

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

      在 Chrome 打包應用程序中通過 XHR 加載本地內容

      Loading local content through XHR in a Chrome packaged app(在 Chrome 打包應用程序中通過 XHR 加載本地內容)
        <tbody id='OgZXh'></tbody>

      <small id='OgZXh'></small><noframes id='OgZXh'>

      <tfoot id='OgZXh'></tfoot>
        • <bdo id='OgZXh'></bdo><ul id='OgZXh'></ul>
          • <legend id='OgZXh'><style id='OgZXh'><dir id='OgZXh'><q id='OgZXh'></q></dir></style></legend>

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

              • 本文介紹了在 Chrome 打包應用程序中通過 XHR 加載本地內容的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在嘗試加載使用 Backbone 構建的 Web 應用程序,它會提取本地存儲的 JSON 和 HTML 模板文件.我想知道 Chrome 打包應用是否可以通過使用某種get"/ajax 請求來加載這些文件?

                I'm trying to load in a web app that I've built using Backbone and it pulls in JSON and HTML template files that are stored locally. I was wondering with Chrome packaged apps whether it's possible to load these files by using some sort of 'get'/ajax request?

                目前我正在接受這個......

                Currently I'm getting this...

                OPTIONS chrome-extension://fibpcbellfjkmapljkjdlpgencmekhco/templates/templates.html Cannot make any requests from null. jquery.min.js:2
                XMLHttpRequest cannot load chrome-extension://fibpcbellfjkmapljkjdlpgencmekhco/templates/templates.html. Cannot make any requests from null.
                

                我找不到任何有關如何執行此操作的真實信息,因此非常感謝您的幫助!

                I can't find any real information on how to do this so any help would be great thanks!

                推薦答案

                是的,這完全有可能,而且很簡單.這是一個工作示例.嘗試從這個開始,確認它有效,然后添加回您自己的代碼.如果您遇到障礙并想出一個比 XHR 是否適用于打包應用程序更具體的問題,您可能想問一個新問題.

                Yes, it's totally possible, and it's easy. Here's a working sample. Try starting with this, confirm that it works, and then add back in your own code. If you hit a roadblock and come up with a more specific question than whether XHRs work in packaged apps, you might want to ask a new question.

                manifest.json:

                manifest.json:

                {
                  "name": "SO 15977151 for EggCup",
                  "description": "Demonstrates local XHR",
                  "manifest_version" : 2,
                  "version" : "0.1",
                  "app" : {
                    "background" : {
                      "scripts" : ["background.js"]
                    }
                  },
                  "permissions" : []
                }
                

                background.js:

                background.js:

                chrome.app.runtime.onLaunched.addListener(function() {
                  chrome.app.window.create("window.html",
                    { bounds: { width: 600, height: 400 }});
                });
                

                window.html:

                window.html:

                <html>
                <body>
                  <div>The content is "<span id="content"/>"</div>
                  <script src="main.js"></script>
                </body>
                </html>
                

                main.js:

                function requestListener() {
                  document.querySelector("#content").innerHTML = this.responseText;
                };
                
                onload = function() {
                  var request = new XMLHttpRequest();
                  request.onload = requestListener;
                  request.open("GET", "content.txt", true);
                  request.send();
                };
                

                內容.txt:

                Hello, world!
                

                這篇關于在 Chrome 打包應用程序中通過 XHR 加載本地內容的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)

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

                    • <bdo id='RLKJb'></bdo><ul id='RLKJb'></ul>
                      <legend id='RLKJb'><style id='RLKJb'><dir id='RLKJb'><q id='RLKJb'></q></dir></style></legend>

                      <small id='RLKJb'></small><noframes id='RLKJb'>

                      <tfoot id='RLKJb'></tfoot>

                            <tbody id='RLKJb'></tbody>
                        • 主站蜘蛛池模板: 日韩在线一区二区三区 | 欧美日一区二区 | 一区二区三区高清不卡 | 久久久久精 | 中文字幕日韩欧美一区二区三区 | 一区二区中文字幕 | 亚洲欧美国产精品久久 | 99亚洲精品视频 | 中文字幕色站 | 97国产精品视频人人做人人爱 | 日韩一区二区在线视频 | 中文字幕第一页在线 | 色小姐综合网 | 大学生a级毛片免费视频 | 久久高清 | 无码日韩精品一区二区免费 | 日韩一区二区三区在线观看 | 国产女人第一次做爰毛片 | 国产精品777一区二区 | 亚洲狠狠 | 成人一级毛片 | 中文字幕一区二区三区四区 | 亚洲欧美日韩久久久 | 亚洲欧美在线一区 | 中文字幕精品视频在线观看 | 最新免费av网站 | 精精国产xxxx视频在线野外 | 一本色道久久综合亚洲精品高清 | 欧美国产日韩在线观看 | a爱视频 | 国产激情一区二区三区 | 国产精品久久 | 日韩另类 | 欧美精品久久久久 | 81精品国产乱码久久久久久 | 欧美日韩在线精品 | 观看av| 亚洲高清一区二区三区 | 久久久91精品国产一区二区三区 | 国产一卡二卡三卡 | 在线免费观看日本 |