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

      <small id='6NF0R'></small><noframes id='6NF0R'>

      1. <tfoot id='6NF0R'></tfoot>
        • <bdo id='6NF0R'></bdo><ul id='6NF0R'></ul>
      2. Angularjs $window.open 弹出窗口被阻止

        时间:2023-09-30
          • <bdo id='aFHNo'></bdo><ul id='aFHNo'></ul>

            1. <legend id='aFHNo'><style id='aFHNo'><dir id='aFHNo'><q id='aFHNo'></q></dir></style></legend>
                • <small id='aFHNo'></small><noframes id='aFHNo'>

                  <tfoot id='aFHNo'></tfoot>

                    <tbody id='aFHNo'></tbody>

                  <i id='aFHNo'><tr id='aFHNo'><dt id='aFHNo'><q id='aFHNo'><span id='aFHNo'><b id='aFHNo'><form id='aFHNo'><ins id='aFHNo'></ins><ul id='aFHNo'></ul><sub id='aFHNo'></sub></form><legend id='aFHNo'></legend><bdo id='aFHNo'><pre id='aFHNo'><center id='aFHNo'></center></pre></bdo></b><th id='aFHNo'></th></span></q></dt></tr></i><div id='aFHNo'><tfoot id='aFHNo'></tfoot><dl id='aFHNo'><fieldset id='aFHNo'></fieldset></dl></div>
                  本文介绍了Angularjs $window.open 弹出窗口被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 Github API 的 网络身份验证流程从 AngularJS 应用程序中.当我的注册表单提交时,我想打开一个新窗口将它们发送到身份验证页面.通常我只会在用户事件中使用 window.open 以确保它不会被弹出窗口阻止程序捕获.

                  I am trying to use the Github API's web auth flow from within an AngularJS app. When my signup form submits, I want to open a new window to send them to the the auth page. Normally I would just use window.open inside a user event to ensure it wouldn't get caught by a popup blocker.

                  在我的 Angular 应用程序中,我在 Angular 服务中封装了一些 Github api,打开窗口的代码就在其中.正因为如此,它被阻塞了.我还尝试将它放在控制器中的一个函数中,该函数由表单通过 ng-submit 调用.

                  In my angular app, I am wrapping a bit of the Github api in and Angular service, and the code to open the window goes in there. Because of that it gets blocked. I also tried putting it in a function in the controller that gets called by a form via ng-submit.

                  所以问题是,有没有一种优雅的方法可以从我的服务或控制器内部的某个地方打开表单提交的新页面,还是我需要找到另一种方法来做到这一点?

                  So the question is, is there an elegant way to open a new page on a form submit from somewhere inside my service or controller, or will I need to find another way to do it?

                  推荐答案

                  您无法摆脱脚本自动化 window.open 的弹出窗口阻止程序.只有真实用户的号召性用语事件才会打开一个新窗口,而不会被弹出窗口阻止程序阻止.想象一个网站的情况,浏览器中没有弹出窗口阻止程序,而 javascript 循环打开 100 个弹出窗口.你想要吗?它曾经像病毒一样在我们过去的美好时光中存在,但现代浏览器非常聪明,并且可以优雅地处理这种烦恼.

                  You can't get rid of the popup blocker for scripted automated window.open. Only real user's call to action events will open a new window without being blocked by popup blocker. Imagine a situation in a site where there's no popup blocker in browser and javascript opens 100 popups in a loop. Would you like it ? It used to be there in our old good times like a virus but modern browsers are much smart and this annoyance is handled gracefully.

                  这篇关于Angularjs $window.open 弹出窗口被阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:javascript (window.open) 在所有浏览器中打开最大化,但在 chrome 中不打开 下一篇:jquery可以做到这一点吗?值的弹出窗口

                  相关文章

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

                    <tfoot id='eQRt4'></tfoot>
                    <legend id='eQRt4'><style id='eQRt4'><dir id='eQRt4'><q id='eQRt4'></q></dir></style></legend>
                      <bdo id='eQRt4'></bdo><ul id='eQRt4'></ul>

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