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

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

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

        时间:2023-10-14

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

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

            <legend id='yP61s'><style id='yP61s'><dir id='yP61s'><q id='yP61s'></q></dir></style></legend>
            <tfoot id='yP61s'></tfoot>

                • <bdo id='yP61s'></bdo><ul id='yP61s'></ul>
                    <tbody id='yP61s'></tbody>
                  本文介绍了Access-Control-Allow-Origin 不允许 XMLHttpRequest Origin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试通过 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                  相关文章

                  最新文章

                • <small id='DbhoR'></small><noframes id='DbhoR'>

                    <legend id='DbhoR'><style id='DbhoR'><dir id='DbhoR'><q id='DbhoR'></q></dir></style></legend>
                    • <bdo id='DbhoR'></bdo><ul id='DbhoR'></ul>

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

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