久久久久久久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>

                          主站蜘蛛池模板: 日韩欧美精品一区 | 在线免费观看亚洲 | 麻豆毛片 | 99国内精品久久久久久久 | 99久久精品国产一区二区三区 | 国产精品久久久久久一区二区三区 | 国产一级电影网 | 国产日韩久久 | 欧美一级淫片免费视频黄 | 免费观看一级特黄欧美大片 | 精品福利一区二区三区 | 久久久久国产精品 | 999久久久 | 日日操夜夜干 | 国产精品久久久久久久白浊 | 国产网站在线免费观看 | 中文字幕亚洲精品在线观看 | 国产成人精品一区二区三区在线 | 国产高清视频一区二区 | 欧美一级做a爰片免费视频 国产美女特级嫩嫩嫩bbb片 | 91中文视频 | 精品国产乱码一区二区三区a | 国产精品久久久久久久粉嫩 | 国内自拍第一页 | 激情视频网站 | 天天搞夜夜操 | 中文欧美日韩 | 国内精品久久精品 | 欧美性大战久久久久久久蜜臀 | 国产一区二区av | 成人在线免费观看 | 一区二区精品在线 | 91精品中文字幕一区二区三区 | a在线视频 | 国产熟熟 | 日韩资源| 色狠狠桃花综合 | 九一视频在线播放 | 日韩视频在线观看中文字幕 | 无码国模国产在线观看 | 国产成人精品网站 |