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

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

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

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

        Access-Control-Allow-Origin 不允许 XMLHttpRequest Origin

        时间:2023-05-16

          <legend id='WcjO3'><style id='WcjO3'><dir id='WcjO3'><q id='WcjO3'></q></dir></style></legend>
              <tbody id='WcjO3'></tbody>
            <tfoot id='WcjO3'></tfoot>
          1. <small id='WcjO3'></small><noframes id='WcjO3'>

              <bdo id='WcjO3'></bdo><ul id='WcjO3'></ul>
                • <i id='WcjO3'><tr id='WcjO3'><dt id='WcjO3'><q id='WcjO3'><span id='WcjO3'><b id='WcjO3'><form id='WcjO3'><ins id='WcjO3'></ins><ul id='WcjO3'></ul><sub id='WcjO3'></sub></form><legend id='WcjO3'></legend><bdo id='WcjO3'><pre id='WcjO3'><center id='WcjO3'></center></pre></bdo></b><th id='WcjO3'></th></span></q></dt></tr></i><div id='WcjO3'><tfoot id='WcjO3'></tfoot><dl id='WcjO3'><fieldset id='WcjO3'></fieldset></dl></div>
                  本文介绍了Access-Control-Allow-Origin 不允许 XMLHttpRequest Origin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试通过 HTTP 从 JavaScript 获取一些简单的文本:

                  I'm trying to fetch some simple text over HTTP from JavaScript:

                  $(function() {
                      $.get("http://mydomain.com/path", function(result) {
                          console.log(result);
                      });
                  });
                  

                  结果应该是text/html,但基本上只是一个简单的键值字符串,没有任何HTML标签.该页面由我控制,但由第三方(闭源)提供,因此我无法修改提供此页面的 Java.

                  The result should be text/html, but is basically only a simple key-value string, no HTML tags whatsoever. The page is in my control, but is supplied by a third-party (closed-source) so I can't modify the Java that serves out this page.

                  如何从 JavaScript 获取此页面的内容?

                  How can I get the contents of this page from JavaScript?

                  推荐答案

                  你只需要使用 PHP/ASP 你的服务器端语言来检索跨域请求或使用由 Yahoo! 创建的跨域 ajax 服务等服务.

                  You've simply gotta use either PHP/ASP your serverside language to retrieve the cross-domain request or use a service such as a cross domain ajax service created by Yahoo!.

                  它使用 JSONP,它允许执行非常严格的跨域请求,但来自 Yahoo!他们将检索互联网上的任何页面.

                  It uses JSONP which is allowed to do very strict cross-domain requests, but asking from Yahoo! they will retrieve any page on the internet.

                  http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/

                  这篇关于Access-Control-Allow-Origin 不允许 XMLHttpRequest Origin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:PC从睡眠模式唤醒时开始调用js函数 下一篇:在同一来源上发出 XMLHttpRequest 时,有没有办法不发送 cookie?

                  相关文章

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

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

                  1. <tfoot id='LWwSL'></tfoot>
                      <bdo id='LWwSL'></bdo><ul id='LWwSL'></ul>

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