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

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

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

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

        使用 AJAX (XMLHttpRequest) 查詢 Wikipedia 的 API

        Query Wikipedia#39;s API using AJAX (XMLHttpRequest)(使用 AJAX (XMLHttpRequest) 查詢 Wikipedia 的 API)
        • <i id='nAN66'><tr id='nAN66'><dt id='nAN66'><q id='nAN66'><span id='nAN66'><b id='nAN66'><form id='nAN66'><ins id='nAN66'></ins><ul id='nAN66'></ul><sub id='nAN66'></sub></form><legend id='nAN66'></legend><bdo id='nAN66'><pre id='nAN66'><center id='nAN66'></center></pre></bdo></b><th id='nAN66'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nAN66'><tfoot id='nAN66'></tfoot><dl id='nAN66'><fieldset id='nAN66'></fieldset></dl></div>
          <tfoot id='nAN66'></tfoot>

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

              • <bdo id='nAN66'></bdo><ul id='nAN66'></ul>

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

                    <tbody id='nAN66'></tbody>
                  本文介紹了使用 AJAX (XMLHttpRequest) 查詢 Wikipedia 的 API的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用 AJAX (XMLHttpRequest) 實現對維基百科 API 的簡單請求.如果我在 Firefox 的地址欄中鍵入 url,我會得到一個整潔的 XML,那里不費吹灰之力.然而,調用完全相同的網址:

                  I am trying to implement a simple request to Wikipedia's API using AJAX (XMLHttpRequest). If I type the url in the address bar of Firefox, I get a neat XML, no sweat there. Yet, calling the exact same url with:

                  // this is my XMLHttpRequest object
                  httpObjectMain.open("GET", "http://en.wikipedia.org/w/api.php?action=query&format=xml&prop=langlinks&lllimit=500&titles=kaas", true);
                  httpObjectMain.send(null);
                  

                  返回一個空響應.根據 FireBug,我得到 200 OK 響應,但內容是空的.

                  returns an empty response. According to FireBug, I get a 200 OK response, but the content is just empty.

                  我懷疑我可能在 GET http 請求的標頭上遺漏了某些內容.

                  I suspect I might be missing something on the header of the GET http request.

                  幫助!(謝謝!)

                  推薦答案

                  維基百科 API 確實支持 JSONP.你的查詢字符串會變成這樣:

                  The Wikipedia API does support JSONP. Your query string'll become something like this:

                  http://en.wikipedia.org/w/api.php?action=query&format=json&callback=test&prop=langlinks&lllimit=500&titles=kaas
                  

                  但是您必須構建 jsonp 處理程序(或者您可以使用您喜歡的庫來執行此操作),從您選擇的 xml 切換到 json 輸出格式并創建回調函數來解析結果并執行您的操作需要在頁面上.

                  But you'll have to build the jsonp handler (or you can use your favorite library to do it), switch to json output format from the xml you choose and create the callback function to parse the result and do the stuff you need on the page.

                  這篇關于使用 AJAX (XMLHttpRequest) 查詢 Wikipedia 的 API的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 部分內容)

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

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

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

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

                            <tfoot id='BiHkW'></tfoot>
                          • 主站蜘蛛池模板: 久久久久久久97 | 97视频网站 | 久久久久久久网 | 一区二区三区在线免费 | 三级在线免费观看 | 97免费在线 | 婷婷在线播放 | 中文字幕超清在线观看 | 中文字幕亚洲视频 | 青草国产 | 中文字幕精品一区久久久久 | 精品福利在线观看 | 一级黄色片免费观看 | 久久午夜影院 | 日本高清www | 成人做受黄大片 | 四川一级毛毛片 | 少妇搡bbbb搡bbb搡毛茸茸 | 久久久麻豆 | 午夜免费小视频 | 色女人影院 | 国产美女网站 | 亚洲免费在线观看视频 | 激情五月婷婷综合 | 精品在线一区 | 九九香蕉视频 | 国产欧美一区二区精品忘忧草 | 99久久久 | 超碰在线观看97 | 俺去俺来也在线www色官网 | 欧美久久一区二区 | www免费视频 | 国产美女视频 | 一区二区三区视频在线 | 在线观看的av网站 | 久久久精品一区二区三区 | 九九在线| 精品在线观看视频 | 九九精品九九 | 久久综合国产 | 久色成人 |