开发者

How to force window.open() to open new tabs, whenever the browser supports them?

I have developed a Web site one of whose requirements was that every link open in a new window or开发者_如何学JAVA tab. For obvious reasons, it is preferable that several tabs, instead of several windows be created. How do I make JavaScript's window.open() function always open a new tab whenever the browser supports them, regardless of other variables (such as whether the user has configured the browser to open new windows rather than tabs)?


You can't override the user's settings. Quite frankly, I would be appalled if you could.

What makes your site special enough that what YOU want it to do is more important than what I want my computer to do?


Ultimately, the browser's own user has complete control of this behavior. At least, the user has such control if she chose the right browser :-)


You can't, the handling of popups is determined by the browser and its user-defined settings. There'd be no point in giving people the option to choose how pop-ups are opened if web developers could bypass them entirely.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜