{ "@context": "https://schema.org", "@type": "Article", "headline": "window.open()失效了?如何解决浏览器阻止新窗口打开的问题", "datePublished": "2025-01-08CST08:32:10+08:00", "dateModified": "2025-01-08CST08:32:10+08:00", "author": {"@type": "Person", "name": "个人技术知识分享"}, "publisher": {"@type": "Organization", "name": "个人技术知识分享"}, "mainEntityOfPage": {"@type": "WebPage", "@id": "https://www.0454.wang/post-1143.html"} }
«

window.open()失效了?如何解决浏览器阻止新窗口打开的问题

时间:2025-1-8 08:32     作者:emer     分类: 无


window.open 问题求助

有网友遇到了如下问题:

执行以下 js 代码后,在大多数浏览器中都能正常打开新窗口:

window.open("http://www.w3school.com.cn", "www", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=300, height=400")
登录后复制

但在某位网友的浏览器中却出现了问题,猜测可能是浏览器的个别设置导致了这种情况。

以上就是window.open()失效了?如何解决浏览器阻止新窗口打开的问题的详细内容,