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

  • <tfoot id='gPWyx'></tfoot>

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

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

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

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

        從 JSON.parse 捕獲異常的正確方法

        Proper way to catch exception from JSON.parse(從 JSON.parse 捕獲異常的正確方法)

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

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

        • <tfoot id='J8C2t'></tfoot>
          <legend id='J8C2t'><style id='J8C2t'><dir id='J8C2t'><q id='J8C2t'></q></dir></style></legend>
                <tbody id='J8C2t'></tbody>

                  <bdo id='J8C2t'></bdo><ul id='J8C2t'></ul>
                  本文介紹了從 JSON.parse 捕獲異常的正確方法的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我在有時(shí)包含 404 響應(yīng)的響應(yīng)上使用 JSON.parse.在它返回 404 的情況下,有沒有辦法捕獲異常然后執(zhí)行一些其他代碼?

                  I’m using JSON.parse on a response that sometimes contains a 404 response. In the cases where it returns 404, is there a way to catch an exception and then execute some other code?

                  data = JSON.parse(response, function (key, value) {
                      var type;
                      if (value && typeof value === 'object') {
                          type = value.type;
                          if (typeof type === 'string' && typeof window[type] === 'function') {
                              return new(window[type])(value);
                          }
                      }
                      return value;
                  });
                  

                  推薦答案

                  我將某些內(nèi)容發(fā)布到 iframe 中,然后使用 json 解析讀回 iframe 的內(nèi)容...所以有時(shí)它不是 json 字符串

                  i post something into an iframe then read back the contents of the iframe with json parse...so sometimes it's not a json string

                  試試這個(gè):

                  if(response) {
                      try {
                          a = JSON.parse(response);
                      } catch(e) {
                          alert(e); // error in the above string (in this case, yes)!
                      }
                  }
                  

                  這篇關(guān)于從 JSON.parse 捕獲異常的正確方法的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(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)容)
                • <i id='o6AN1'><tr id='o6AN1'><dt id='o6AN1'><q id='o6AN1'><span id='o6AN1'><b id='o6AN1'><form id='o6AN1'><ins id='o6AN1'></ins><ul id='o6AN1'></ul><sub id='o6AN1'></sub></form><legend id='o6AN1'></legend><bdo id='o6AN1'><pre id='o6AN1'><center id='o6AN1'></center></pre></bdo></b><th id='o6AN1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='o6AN1'><tfoot id='o6AN1'></tfoot><dl id='o6AN1'><fieldset id='o6AN1'></fieldset></dl></div>
                    <tbody id='o6AN1'></tbody>
                  <tfoot id='o6AN1'></tfoot>

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

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

                            <legend id='o6AN1'><style id='o6AN1'><dir id='o6AN1'><q id='o6AN1'></q></dir></style></legend>
                            主站蜘蛛池模板: 国产免费拔擦拔擦8x高清 | 一区欧美 | 9久久婷婷国产综合精品性色 | 日韩欧美中文字幕在线视频 | 色综合视频 | 国产乱码久久久久久一区二区 | 国产综合视频 | 天天操天天干天天透 | 午夜在线小视频 | 高清成人av | 精品色 | 欧美成人a| 国产清纯白嫩初高生视频在线观看 | 欧美一区二区三区四区视频 | 久久国产欧美一区二区三区精品 | 懂色中文一区二区在线播放 | 欧美精品一二三区 | 精品一区二区免费视频 | 久久福利电影 | 国产精品成人一区二区 | 国产精品不卡一区二区三区 | 一级黄片一级毛片 | 综合久久99 | 福利视频一区二区 | 精品国产一区二区在线 | 欧美综合国产精品久久丁香 | 久久久99国产精品免费 | 日韩一区二区三区视频 | 亚洲成人在线免费 | 激情网站在线观看 | 欧美久久一区二区三区 | 日韩欧美精品一区 | 乱码av午夜噜噜噜噜动漫 | 少妇无套高潮一二三区 | 特a毛片 | 国产一区二 | 日韩av一区二区在线观看 | 国产成人一区在线 | 亚洲精品成人网 | 久久国产精品视频 | 色婷综合网 |