window.open(....)在某些浏览器中被阻止 [英] window.open(....) getting blocked in some browsers
本文介绍了window.open(....)在某些浏览器中被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个脚本,它在执行一些其他脚本后打开一个在线应用程序窗口。
I have a script where it opens a window for online application after executing some other scripts.
window.open()$任何点击都不会调用c $ c>。它会在脚本中调用,浏览器会阻止新窗口出现。
window.open()
is not called on any click. It is getting called in a script and browser prevents the new window from appearing.
如何克服这个问题?
这里是代码..
window.open('/search/applyonline?jobid=".$jobDetails->getIdjob()."',
'applyurljob',
'height=550,\
width=800,\
toolbar=no,\
directories=no,\
status=no,\
menubar=no,\
scrollbars=yes,\
resizable=yes,\
left=200,\
top=250')
推荐答案
弹出窗口阻止程序将阻止打开窗口,这些窗口不响应单击事件。因此,您可以:
Popup blockers will block windows from being opened that are not in response to a click event. Therefore you can:
- 让您的用户关闭弹出窗口拦截器(不太好)。
- 更改脚本以响应链接或按钮单击。
- 使用虚假窗口,例如 jQuery UI对话框。
- Ask your users to turn off their popup blocker (not nice).
- Change your scripts to work in response to a link or button click.
- Use fake windows such as a jQuery UI dialog.
这篇关于window.open(....)在某些浏览器中被阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文