在Chrome和Safari浏览器上的onload事件时,连接不的window.open工作 [英] window.open not working when attached on onload event in chrome and safari

查看:169
本文介绍了在Chrome和Safari浏览器上的onload事件时,连接不的window.open工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经贴在表格的onload事件一些JavaScript。这个脚本包含window.open。虽然这个作品在所有浏览器window.open罚款不打开一个新窗口,也给它在谷歌Chrome和Firefox。

I have attached some javascript on onload event of the form. this script contains window.open. Although this works fine in all the browsers window.open doesn't open a new window nor it gives nay error message in google chrome and firefox.

我要首先检查屏幕分辨率,如果它是小于1024那么我会在新窗口中打开它没有菜单,工具栏和其他人,使用户有更多的空间去努力。

I want to first check the screen resolution if it is less than 1024 then I would open it in a new window without menu,toolbar and others so that the user has more space to work on.

推荐答案

这是一个功能,而不是一个错误! :)

This is a feature, not a bug! :)

记得在90年代时,弹出窗口恼火的废话了大家?嗯,因为在 MASSIVE 滥用的JavaScript行为的,现在打开窗户的唯一途径是直接用户交互;就像一个点击。

remember back in the '90s when pop-up windows annoyed the crap out of everyone? Well, because of the MASSIVE abuse of that JavaScript behavior, now the only way to open windows is with direct user interaction; like a click.

这篇关于在Chrome和Safari浏览器上的onload事件时,连接不的window.open工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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