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

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

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

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

        在經(jīng)典 ASP 頁(yè)面中編寫(xiě) JSON,以及對(duì) Http 響應(yīng)的一

        Writing JSON in Classic ASP page, and general (mis)understanding of Http Response(在經(jīng)典 ASP 頁(yè)面中編寫(xiě) JSON,以及對(duì) Http 響應(yīng)的一般(錯(cuò)誤)理解)

              <small id='4N5SM'></small><noframes id='4N5SM'>

                • <bdo id='4N5SM'></bdo><ul id='4N5SM'></ul>

                • <legend id='4N5SM'><style id='4N5SM'><dir id='4N5SM'><q id='4N5SM'></q></dir></style></legend>

                • <i id='4N5SM'><tr id='4N5SM'><dt id='4N5SM'><q id='4N5SM'><span id='4N5SM'><b id='4N5SM'><form id='4N5SM'><ins id='4N5SM'></ins><ul id='4N5SM'></ul><sub id='4N5SM'></sub></form><legend id='4N5SM'></legend><bdo id='4N5SM'><pre id='4N5SM'><center id='4N5SM'></center></pre></bdo></b><th id='4N5SM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4N5SM'><tfoot id='4N5SM'></tfoot><dl id='4N5SM'><fieldset id='4N5SM'></fieldset></dl></div>
                • <tfoot id='4N5SM'></tfoot>
                    <tbody id='4N5SM'></tbody>
                • 本文介紹了在經(jīng)典 ASP 頁(yè)面中編寫(xiě) JSON,以及對(duì) Http 響應(yīng)的一般(錯(cuò)誤)理解的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我有一個(gè)經(jīng)典的 ASP 頁(yè)面 (VBscript),它在服務(wù)器端生成一個(gè) XML,然后 Response.Writes 它.該頁(yè)面根本沒(méi)有客戶(hù)端.

                  I had a classic ASP page (VBscript) that generates an XML on server-side, and then Response.Writes it. The page had no client side at all.

                  但是我需要將其轉(zhuǎn)換為 JSON.由于我找不到有效的 ASP 服務(wù)器端方式(完全不同的主題),所以我在客戶(hù)端使用我找到的 Javascript 代碼完成了它,最后將它記錄到頁(yè)面中.

                  However I needed to convert it to JSON. Since I could not find an ASP server-side way that worked (whole different subject) I did it on client-side with a Javascript code I found, finally document.writing it to the page.

                  問(wèn)題是結(jié)果不一樣:如果在 http RESPONSE 之前只是一個(gè) XML,那么現(xiàn)在的響應(yīng)是 javascript 代碼,它將 JSON 寫(xiě)入瀏覽器,而不是響應(yīng).我理解對(duì)了嗎?

                  THE PROBLEM is that the result is not the same: If before the http RESPONSE was only an XML, the response now is the javascript code, which writes to the browser the JSON , but not to the response. Am I understanding this right?

                  換句話(huà)說(shuō),如果之前我有一個(gè) xml 作為響應(yīng),那么現(xiàn)在的響應(yīng)是這樣的:

                  In other words, if before I had an xml as the response, now the response is this:

                      <script type="text/javascript">     
                          var xmlObj = parseXml('<%=resultXml%>');    
                          var json = xml2json(xmlObj);    
                          document.write(json);
                      </script>   
                  

                  整個(gè)塊由 ASP 在這樣的方法中調(diào)用:

                  This whole block is called by the ASP inside a method like this:

                  sub writeJsonResult(resultXml) 
                  % > 
                  
                          the above javascript is here
                  
                  < %     end sub
                  % >
                  

                  同樣,瀏覽器明顯顯示 JSON,但使用它的服務(wù)沒(méi)有獲得所需的響應(yīng).有沒(méi)有辦法將 JSON 寫(xiě)為響應(yīng)?我覺(jué)得我遺漏了一些東西并且不太理解這一點(diǎn).

                  So again, visibly the browser shows the JSON, but the service that uses it doesn't get the RESPONSE it needs. Is there a way to write the JSON as response? I feel I am missing something and not quite understanding this.

                  推薦答案

                  AS @Quentin 有 指出;

                  服務(wù)期望獲取 JSON.

                  這意味著試圖通過(guò)處理 JSON 客戶(hù)端來(lái)解決這個(gè)問(wèn)題是行不通的,因?yàn)檫@意味著您已經(jīng)發(fā)回了 text/html HTTP 響應(yīng)而不是 application/json 一.無(wú)法繞過(guò)它,您必須處理 XML 以在服務(wù)器端構(gòu)建 JSON 結(jié)構(gòu),然后使用返回它

                  This means trying to get around that by processing the JSON client-side isn't going to work as that would mean you have sent back a text/html HTTP response instead of a application/json one. There is no getting around it you have to process the XML to build a JSON structure server-side then return it using

                  Response.ContentType = "application/json"
                  

                  有很多適用于 Classic ASP 的 JSON 庫(kù),有的很好,有的很棒,有的簡(jiǎn)直太糟糕了.如果您正在尋找推薦 ASPJSON.com 可能是使用最廣泛的庫(kù)(但奇怪的是,該網(wǎng)站目前似乎已關(guān)閉).

                  There are lots of JSON libraries out there for Classic ASP, some good, some great and some just plain awful. You just need to have a look through and see which one suits you, if you are looking for a recommendation ASPJSON.com is probably the most widely used library (but weirdly the site appears to be down at the moment).

                  如果可能的話(huà),在生成 XML 的地方使用上述庫(kù)將其替換為 JSON,它們中的大多數(shù)都支持直接從數(shù)據(jù)庫(kù)構(gòu)建 JSON 結(jié)構(gòu),從而節(jié)省您自己從 XML 解析和構(gòu)建 JSON 的時(shí)間.

                  If possible where the XML is generated replace this with a JSON using a library like described above, most of them support building JSON structures directly from the database, saving you on parsing and building the JSON from the XML yourself.

                  • 在經(jīng)典 ASP 中解析 JSON 有什么好的庫(kù)嗎?[關(guān)閉]

                  經(jīng)典 ASP JSON 類(lèi) (站點(diǎn)當(dāng)前關(guān)閉)

                  RCDMK 的 JSON 對(duì)象類(lèi) 3.4.1

                  這篇關(guān)于在經(jīng)典 ASP 頁(yè)面中編寫(xiě) JSON,以及對(duì) Http 響應(yīng)的一般(錯(cuò)誤)理解的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  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 無(wú)法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開(kāi)發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                • <small id='htSdu'></small><noframes id='htSdu'>

                    <tbody id='htSdu'></tbody>

                  <tfoot id='htSdu'></tfoot>
                      <bdo id='htSdu'></bdo><ul id='htSdu'></ul>

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

                          1. 主站蜘蛛池模板: 成人国产在线视频 | 日韩电影中文字幕在线观看 | 美日韩视频| 毛片99 | 日韩一级欧美一级 | 欧美色综合一区二区三区 | 成人在线观看免费观看 | www97影院| 亚洲一区二区国产 | 成人福利在线观看 | 天天搞天天操 | 久久av一区 | 午夜影视网 | 91pao对白在线播放 | 国产精品一区二区久久精品爱微奶 | 久久久久久国产 | 91午夜在线 | 日本视频免费 | 夫妻午夜影院 | 女人精96xxx免费网站p | 视频在线一区二区 | 欧美日韩国产在线观看 | 免费精品视频在线观看 | 日本一级淫片免费啪啪3 | 国产精品久久久久久久久久免费看 | 久久99精品久久久久久琪琪 | 亚洲福利在线视频 | 日韩精品一区二区三区中文在线 | 久久手机视频 | www.yw193.com| 精品九九九 | 国产视频第一页 | 日韩精品久久一区二区三区 | 天天夜干| 视频一区二区中文字幕日韩 | 99视频在线免费观看 | 亚洲精品欧美一区二区三区 | 九一视频在线观看 | 亚洲精品视频一区 | 日本aⅴ中文字幕 | 久久se精品一区精品二区 |