在.8中,窗口.open没有在页面加载时打开 [英] window .open is not opening on page load in ie8

查看:89
本文介绍了在.8中,窗口.open没有在页面加载时打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好无法打开window.open在页面加载ie8如果我使用window.location它不在新页面打开请帮我解决这个问题。

Hi unable to open window.open on page load in ie8 If I use window.location its not opening in new page please help me out of this.

推荐答案

这是因为你遇到了弹出窗口阻止程序。这是一件好事(tm) :-)你只能打开弹出窗口以响应用户采取明确的行动,比如点击某些东西(然后通常只在事件处理程序本身内),而不是在诸如页面加载之类的东西上,不知情的用户可能(并且历史上已经被)淹没了数十个窗户,这些窗户遍布整个地方。 (甚至某些阻止者也不允许这样做以回应明确的用户操作。)

This is because you're running into the popup blocker. This is a Good Thing(tm) :-) You can only open popups in response to the user taking an explicit action, like clicking something (and then typically only from within the event handler itself), not on things like page load where the unwitting user could be (and historically has been) inundated with dozens of windows opening all over the place. (And even doing it in response to an explicit user action may not be allowed by some blockers.)

这篇关于在.8中,窗口.open没有在页面加载时打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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