<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 成功处理程序中阻止的弹出窗口

      popup window blocked in ajax success handler(ajax 成功处理程序中阻止的弹出窗口)

        <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 成功处理程序中阻止的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                append() 方法在被选元素的结尾(仍然在内部)插入指定内容。 语法: $(selector).append( content ) var creatPrintList = function(data){ var innerHtml = ""; for(var i =0;i data.length;i++){ innerHtml +="li class='contentLi'"; innerHtml +="a href
                问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                Ordinals in words javascript(javascript中的序数)
                    <tbody id='SAST1'></tbody>

                  • <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>