如何在不使用JavaScript的情况下一次单击即可打开两个页面? [英] How can I open two pages from a single click without using JavaScript?

查看:70
本文介绍了如何在不使用JavaScript的情况下一次单击即可打开两个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在链接中有一些文字.当我单击它时,我必须打开2页.这里没问题...但是诀窍是不允许我使用JavaScript.这仅适用于HTML吗?

I have some text in a link. When I click on it I must open 2 pages. No problem here... but the trick is that I am not allowed to use JavaScript. Is this possible only with HTML?

推荐答案

如果没有JavaScript,则无法通过单击一个链接来打开两个页面,除非两个页面都位于单击链接后可以打开的一页上.使用JS,这很简单:

Without JavaScript, it's not possible to open two pages by clicking one link unless both pages are framed on the one page that opens from clicking the link. With JS it's trivial:

<p><a href="#" onclick="window.open('http://google.com');
    window.open('http://yahoo.com');">Click to open Google and Yahoo</a></p>

请注意,这将被内置在Web浏览器中的弹出窗口阻止程序阻止,但通常会通知您.

Do note that this will be blocked by popup blockers built into web browsers but you are usually notified of this.

这篇关于如何在不使用JavaScript的情况下一次单击即可打开两个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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