javascript window.open 在 Safari 中 [英] javascript window.open in safari

查看:36
本文介绍了javascript window.open 在 Safari 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 safari(ipad 和桌面版本)中打开一个围绕弹出窗口阻止程序的新窗口时遇到了问题.基本上我发现如果 window.open 不是从点击事件中调用的,safari 将阻止弹出窗口.

I've run into an issue with opening a new window in safari (both ipad and desktop versions) that revolves around the popup blocker. Basically I've found that if window.open isn't called from a click event, safari will block the popup.

调用 window.open 的事件当前已从列表框中更改.

The event that is calling window.open is currently onchanged from a list box.

在这种情况下,除了切换我们处理的事件来诱使 safari 允许弹出窗口之外,还有其他方法吗?(onchanged 事件)

Is there any way other than switching which event we handle to trick safari into allowing a popup in this scenario? (the onchanged event)

推荐答案

我认为除了单击按钮之外,没有其他方法可以在移动 Safari 中打开新窗口.请参阅类似的 StackOverflow 问题.我不确定它是否会起作用,但您可以查看 以编程方式触发按钮点击使用 jquery 的 trigger() 函数.

I don't think there is a way to open a new window in mobile safari other than from a button click. Refer to this StackOverflow Question which is similar. I'm not sure if it will work, but you can look at triggering a button click programatically using jquery's trigger() function.

您可能还想查看在您自己的页面中显示对话框的选项,可能使用 jquery ui 等工具.

You might also want to look at options of showing a dialog within your own page, maybe using tools like jquery ui.

HTH!

这篇关于javascript window.open 在 Safari 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆