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

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

      1. <small id='TPhmR'></small><noframes id='TPhmR'>

      2. <legend id='TPhmR'><style id='TPhmR'><dir id='TPhmR'><q id='TPhmR'></q></dir></style></legend>
        <tfoot id='TPhmR'></tfoot>

        AJAX 请求和普通浏览器请求的区别

        Difference between AJAX request and a regular browser request(AJAX 请求和普通浏览器请求的区别)
          <legend id='qIFrz'><style id='qIFrz'><dir id='qIFrz'><q id='qIFrz'></q></dir></style></legend>
          • <bdo id='qIFrz'></bdo><ul id='qIFrz'></ul>
                  <tbody id='qIFrz'></tbody>

                1. <tfoot id='qIFrz'></tfoot>
                  <i id='qIFrz'><tr id='qIFrz'><dt id='qIFrz'><q id='qIFrz'><span id='qIFrz'><b id='qIFrz'><form id='qIFrz'><ins id='qIFrz'></ins><ul id='qIFrz'></ul><sub id='qIFrz'></sub></form><legend id='qIFrz'></legend><bdo id='qIFrz'><pre id='qIFrz'><center id='qIFrz'></center></pre></bdo></b><th id='qIFrz'></th></span></q></dt></tr></i><div id='qIFrz'><tfoot id='qIFrz'></tfoot><dl id='qIFrz'><fieldset id='qIFrz'></fieldset></dl></div>
                2. <small id='qIFrz'></small><noframes id='qIFrz'>

                  本文介绍了AJAX 请求和普通浏览器请求的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  AJAX 请求和直接浏览器请求之间有区别吗(就网页的调用和加载方式而言)?

                  Is there a difference between an AJAX request and a direct browser request (in terms of how a web page is called and loaded)?

                  换句话说,我的意思是:直接服务器端请求的处理方式是否不同于客户端请求(由浏览器发起)?

                  In other words, I mean: is a direct server-side request handled in any way differently than a client-side request (initiated by the browser)?

                  推荐答案

                  就服务器而言,AJAX 请求与正常"浏览器请求相同,除了可能略有不同的 HTTP 标头.例如chrome 发送:

                  An AJAX request is identical to a "normal" browser request as far as the server is concerned other than potentially slightly different HTTP headers. e.g. chrome sends:

                  X-Requested-With:XMLHttpRequest
                  

                  我不确定该标头是否标准化,或者它是否在每个浏览器中都不同,甚至是否在每个浏览器中都包含 .

                  I'm not sure if that header is standardized or not, or if it's different in every browser or even included at all in every browser.

                  我收回这一点,该标头是由 jQuery(可能还有其他 JS 库)发送的,而不是由浏览器发送的,如下所示:

                  edit: I take that back, that header is sent by jQuery (and likely other JS libraries), not the browser as is evidenced by:

                  var xhr = new XMLHttpRequest();
                  xhr.open('GET', '/');
                  xhr.send();
                  

                  发送:

                  Accept:*/*
                  Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
                  Accept-Encoding:gzip,deflate,sdch
                  Accept-Language:en-US,en;q=0.8
                  Connection:keep-alive
                  Cookie: ....
                  Host:stackoverflow.com
                  If-Modified-Since:Sat, 31 Dec 2011 01:57:24 GMT
                  Referer:http://stackoverflow.com/questions/8685750/how-does-an-ajax-request-differ-from-a-normal-browser-request/8685758
                  User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.12 Safari/535.11
                  

                  这使我得出结论,默认情况下绝对没有区别.

                  which leads me to the conclusion that by default there is absolutely no difference.

                  这篇关于AJAX 请求和普通浏览器请求的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  SCRIPT5: Access is denied in IE9 on xmlhttprequest(SCRIPT5:在 IE9 中对 xmlhttprequest 的访问被拒绝)
                  XMLHttpRequest module not defined/found(XMLHttpRequest 模块未定义/未找到)
                  Show a progress bar for downloading files using XHR2/AJAX(显示使用 XHR2/AJAX 下载文件的进度条)
                  How can I open a JSON file in JavaScript without jQuery?(如何在没有 jQuery 的情况下在 JavaScript 中打开 JSON 文件?)
                  How do I get the HTTP status code with jQuery?(如何使用 jQuery 获取 HTTP 状态码?)
                  quot;Origin null is not allowed by Access-Control-Allow-Originquot; in Chrome. Why?(“Access-Control-Allow-Origin 不允许 Origin null在铬.为什么?)
                3. <small id='5oDvB'></small><noframes id='5oDvB'>

                    <tfoot id='5oDvB'></tfoot>

                      <tbody id='5oDvB'></tbody>

                  1. <legend id='5oDvB'><style id='5oDvB'><dir id='5oDvB'><q id='5oDvB'></q></dir></style></legend>
                    <i id='5oDvB'><tr id='5oDvB'><dt id='5oDvB'><q id='5oDvB'><span id='5oDvB'><b id='5oDvB'><form id='5oDvB'><ins id='5oDvB'></ins><ul id='5oDvB'></ul><sub id='5oDvB'></sub></form><legend id='5oDvB'></legend><bdo id='5oDvB'><pre id='5oDvB'><center id='5oDvB'></center></pre></bdo></b><th id='5oDvB'></th></span></q></dt></tr></i><div id='5oDvB'><tfoot id='5oDvB'></tfoot><dl id='5oDvB'><fieldset id='5oDvB'></fieldset></dl></div>
                        <bdo id='5oDvB'></bdo><ul id='5oDvB'></ul>