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

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

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

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

      跨域 JSON 請求?

      Cross-domain JSON request?(跨域 JSON 請求?)

          <tfoot id='V7hwv'></tfoot>

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

          <legend id='V7hwv'><style id='V7hwv'><dir id='V7hwv'><q id='V7hwv'></q></dir></style></legend>
            <tbody id='V7hwv'></tbody>

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

                <bdo id='V7hwv'></bdo><ul id='V7hwv'></ul>
              • 本文介紹了跨域 JSON 請求?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                問題:

                我正在嘗試跨域使用 JSON,但我發現的只是 JSON 解析器,我不需要...
                我讀過可以使用 JSON 進行跨域請求,但到目前為止,我看到的只是使用 XMLHttpRequest 的實現...
                - 這意味著您不能使用跨域請求,至少不能在 IE 8 之外使用......
                我一直在 http://www.json.org/,但我發現的只是解析器還是沒用.

                到目前為止,我在谷歌上找到的最好的是
                http://devpro.it/JSON/files/JSONRequest-js.html
                但這相當混亂,不能跨域工作,也不能在域內工作 - 或者根本不工作......

                I'm trying to use JSON accross domains, but all i find is JSON parsers, which I don't need...
                I've read that it's possible to do cross-domain requests with JSON, but so far, all I see is implementations that use XMLHttpRequest...
                - which means you can't use cross-domain requests, at least not outside IE 8...
                I've been on http://www.json.org/, but all I find is either parsers or useless.

                The best I've found with google so far is
                http://devpro.it/JSON/files/JSONRequest-js.html
                but this is rather a mess, doesn't work cross domain, and intra-domain neither - or rather not at all...

                var the_object = {}; 
                var http_request = new XMLHttpRequest();
                http_request.open( "GET", url, true );
                http_request.onreadystatechange = function () {
                    if ( http_request.readyState == 4 && http_request.status == 200 ) {
                            the_object = JSON.parse( http_request.responseText );
                        }
                };
                http_request.send(null);
                

                推薦答案

                你可以做的跨域注入腳本包括:

                What you can do cross-domain is inject a script include:

                var s = document.createElement('script');
                s.src = 'http://someotherdomain/getMeMyJs.aspx?parameter=value';
                s.onload = someOptionalCallback;
                s.type = 'text/javascript';
                
                if(document.getElementsByTagName('head').length > 0)
                    document.getElementsByTagName('head')[0].appendChild(s);
                

                現在,該請求返回的代碼將立即執行.如果您希望它與您的代碼交互,您可以確保它與包裝在函數調用中的所有數據一起返回:

                Now, the code returned by that request will be executed immediately. If you want for that to interact with your code, you can make sure that it's being returned with all data wrapped in a function call:

                jsonCallback({ object: json, whatever: value });
                

                您可以使用它來構建 API,在其中將回調函數的名稱作為請求查詢字符串參數傳遞.這是一個這樣的 API 示例

                You can use that to build APIs, where you pass the name of a callback function as a request querystring parameter. Here's an example of such an API

                這篇關于跨域 JSON 請求?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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. <legend id='MhU6X'><style id='MhU6X'><dir id='MhU6X'><q id='MhU6X'></q></dir></style></legend>
                    <tbody id='MhU6X'></tbody>

                      <bdo id='MhU6X'></bdo><ul id='MhU6X'></ul>
                    • <small id='MhU6X'></small><noframes id='MhU6X'>

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

                          主站蜘蛛池模板: 精品国产乱码久久久久久久久 | 麻豆久久久久久久 | 久久aⅴ乱码一区二区三区 亚洲国产成人精品久久久国产成人一区 | a级毛片国产 | 久久性av| 久久久久久免费毛片精品 | 欧美在线观看免费观看视频 | 亚洲一区在线日韩在线深爱 | 欧美激情一区二区三区 | 国产高清在线观看 | 天天操天天射综合网 | 日本高清视频在线播放 | 亚洲美女视频 | 免费观看一级特黄欧美大片 | 羞羞视频在线观看网站 | www.亚洲一区二区三区 | 国产精品无 | 久久精品久久久 | 成人av一区二区三区 | 五月激情婷婷在线 | 欧美日韩精品中文字幕 | 在线免费观看a级片 | 在线一级片 | 免费在线一区二区 | 日韩在线一区二区三区 | 成人影视网址 | 精品国产aⅴ | 日韩精品成人 | 亚洲视频免费在线播放 | 精品久久久久久 | 天天色天天射天天干 | 一区二区av | 日本精品视频在线 | 中文字幕一区二区三区在线视频 | 亚洲精品久久久久久首妖 | 国产欧美视频一区二区 | 国产精品久久二区 | 欧美一区二区三区在线视频 | 色综合一区二区三区 | 黄网站免费在线观看 | 亚洲人成人一区二区在线观看 |