<tfoot id='ra9TN'></tfoot>

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

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

    1. <legend id='ra9TN'><style id='ra9TN'><dir id='ra9TN'><q id='ra9TN'></q></dir></style></legend>
      • <bdo id='ra9TN'></bdo><ul id='ra9TN'></ul>

      ajax 成功处理程序中阻止的弹出窗口

      时间:2023-10-01

        <tfoot id='0y7yi'></tfoot>

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

                <small id='0y7yi'></small><noframes id='0y7yi'>

                  <tbody id='0y7yi'></tbody>
              1. 本文介绍了ajax 成功处理程序中阻止的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                I am trying to open a popup window to allow a user to authenticate with twitter without having to leave the page they are viewing. I have seen this technique used around the web, particularly with the Disqus commenting application. However, I am only able to get two results, either a 'Popup window blocked' message or nothing even happens.

                I have tried using the approaches outlined here and here. How can I fix this?

                My code currently looks like:

                var windowSizeArray = [ "width=200,height=200",
                                            "width=300,height=400,scrollbars=yes" ];
                var url = $('.twitter_popup').attr("href");
                var windowName = $('.twitter_popup').attr("name");
                var windowSize = windowSizeArray[$('.twitter_popup').attr("rel")];
                window.open(url, windowName, windowSize);
                

                解决方案

                The popup blockers on the browser block the the popups when the code is executing in the script execution context.

                E.g If we open a new window on an anchor click the popup blocker will not block it but if we try to open a new window using setTimeout you will see that popup blocker will block this. It is because when timeout is reached the context is now script execution context instead of user action. This is the same behavior when we try to open a new window in an ajax callback handler.

                I think you are into similar such situation.

                Live example

                If for some reason you want to open the popup in ajax success handler itself then you can achieve it by making a synchronous ajax call. The popup will not be blocked.

                这篇关于ajax 成功处理程序中阻止的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:JavaScript/jQuery - 在弹出窗口中打开当前链接 下一篇:如何将数据从弹出窗口传递到父窗口?

                相关文章

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

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

                  <tfoot id='SAST1'></tfoot>

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

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