目标=_blank 还是不目标=_blank,这是个问题! [英] To target=_blank or not to target=_blank, that is the question!

查看:27
本文介绍了目标=_blank 还是不目标=_blank,这是个问题!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

指向外部站点的链接是否应该设置 target=_blank?例如.我在 www.acme.net 上有一个指向 www.otherplace.net 的链接,该链接应该是:

Should links to external sites set target=_blank? E.g. I am on www.acme.net and have a link to www.otherplace.net, should that link be:

<a href='http://www.otherplace.net' target='_blank'>otherplace 的网站</a>

<a href='http://www.otherplace.net' target='_blank'>otherplace's website</a>

或:

<a href='http://www.otherplace.net'>otherplace 的网站</a>

<a href='http://www.otherplace.net'>otherplace's website</a>

我的印象是,对域外站点使用 _blank 是最佳做法,但现在我被告知并非如此.

I was under the impression that using _blank to sites outside your domain was best practice, but now I am being told otherwise.

推荐答案

一些网络理想主义者会说,当涉及到导航时,您应该允许用户做出自己的选择——我非常认同这种观点.作为网络开发者,我们不应将此类决定强加于访问者.

Some web idealists will state that you should allow the user to make their own choices when it comes to navigation - I have a lot of sympathy with this view. As web developers, we shouldn't be forcing such decisions on our visitors.

但是,我也知道企业通常希望保留控制权",因此坚持为外部站点生成新的标签/窗口.我也理解这一点 - 这是一种非常实用的方法,特别是当您考虑到有多少用户不知道如何控制他们自己的 UA 时.

However, I also know that businesses often want to 'retain control' and so insist on spawning a new tab/window for external sites. An I understand this too - It's a very practical approach, particularly when you consider that how many users don't know how to control their own UA.

我经常倾向于在两者之间选择中间路线,通过添加一个图像(我相信你在这段时间里会看到很多)表明哪些链接是外部的,并且注释 表示外部链接将在新选项卡/窗口中打开.

I often tend to steer a middle course between the two, by adding an image (I'm sure you will have seen many in your time) that indicates which links are external, and a note to indicate that external links will open in a new tab/window.

不像第一个选项那么纯粹",但至少用户很清楚网站的行为方式.

这篇关于目标=_blank 还是不目标=_blank,这是个问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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