<tfoot id='TU5AF'></tfoot>

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

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

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

      带返回值的跨域弹窗

      Cross domain popup window with return value(带返回值的跨域弹窗)

          <tbody id='wLijx'></tbody>

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

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

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

              1. 本文介绍了带返回值的跨域弹窗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                这是设置:

                我在两个不同的域上有两个网站:

                • www.website1.com
                • www.someotherwebsite.com

                这就是我想做的:

                1. 当用户在 www.website1.com 上并单击链接时,我希望弹出一个显示 www.someotherwebsite.com 的窗口..p>

                2. 当用户单击弹出窗口中的按钮(显示 www.someotherwebsite.com)时,我希望该窗口关闭并返回一个值.

                3. 我希望将弹出窗口返回的值放在 www.website1.com.

                我希望这是有道理的.我只需要使用没有外部库的 HTML 和 Javascript.它还必须适用于当前的主流浏览器(即不是 HTML5 的东西).

                提前感谢您的帮助.

                解决方案

                好吧,如果你在弹出窗口中使用 iframe [在这个时代,我会避免像瘟疫那样弹出窗口,因为弹出窗口阻止程序]

                使用 iframe,您可以进行 跨域调用

                你为什么不开发一个从 A 到 B 的 web 服务并从 A 调用它?似乎比在浏览器中发现小裂缝来绕过安全性要干净得多.

                This is the setup:

                I have two websites on two different domains:

                • www.website1.com
                • www.someotherwebsite.com

                This is what I want to do:

                1. When a user is on www.website1.com and clicks a link, I want a window to popup showing www.someotherwebsite.com.

                2. When the user clicks a button in the popup window (showing www.someotherwebsite.com) I want that window to close and have a value returned.

                3. I want the value returned from the popup window to be placed (into a div, or into a javascript call, or someplace accessible such as filling out a form field) on www.website1.com.

                I hope that makes sense. I need to use just HTML and Javascript without external libraries. It also must work on current mainstream browsers (i.e. not be an HTML5 thing).

                Thank you in advance for your help.

                解决方案

                Well if you use an iframe in your pop up window [in this day in age I would avoid pop up windows like the plague due to pop up blockers]

                With an iframe you can make cross domain calls

                Why don't you just develop a webservice from A to B and call it from A? Seems so much cleaner than finding small cracks in browsers to get around security.

                这篇关于带返回值的跨域弹窗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))
              2. <legend id='PUBQ1'><style id='PUBQ1'><dir id='PUBQ1'><q id='PUBQ1'></q></dir></style></legend>
                  <bdo id='PUBQ1'></bdo><ul id='PUBQ1'></ul>

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

                      <tbody id='PUBQ1'></tbody>
                  1. <tfoot id='PUBQ1'></tfoot>

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