繁体   English   中英

window.open()在Ajax中不起作用

[英]window.open() not working in ajax

我只想在ajax返回成功之后才打开一个窗口。 但这行不通。 窗口无法打开。 以下是示例代码。

 $.ajax({
           type: "POST",
            url : 'checkIfMemberIsAPaidMember.php',  
            dataType : "html",
            success: function(data)
            {  
                var w = window.open('expressInterestPopUp.php','_blank','resizable = no, toolbar = 0,location = no, menubar = 0, height = 400, width = 600, left = 400,top = 300');

                },
            error : function()
            {       
                    alert("Sorry, The requested property could not be  found.");    

            }
    }); 

请用

async:false

在ajax中,调用。 这是因为浏览器限制了在ajax调用中打开弹出窗口。 如果ajax调用是同步的,则窗口将打开,没有任何问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM