在新窗口中打开链接。什么是“正确的”办法? [英] Opening Links in a new window. What's the "right" way?

查看:54
本文介绍了在新窗口中打开链接。什么是“正确的”办法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


有时我想在新窗口中打开超链接(图片等)。在

过去,我使用了target =" _blank"在新窗口中打开链接。但是,

使用目标属性导致我的页面验证失败(严格

doctype)。验证器说没有属性''目标''..


所以...如何在没有Javscript的情况下在新窗口中打开链接并传递

严格验证?


-

Viken K.
http://home.comcast.net/~vikenk

Hello all,

On occasion I want to open hyperlinks (images, etc.) in a new window. In the
past, I''ve used target="_blank" to open the link in a new window. However,
using the "target" attribute causes my pages to fail validation (strict
doctype). The validator says "There is no attribute ''target''.."

So...how do I open a link in a new window, without Javscript, and pass
strict validation?

--
Viken K.
http://home.comcast.net/~vikenk

推荐答案

" Viken Karaguesian" < 6 **** @ NOSPAMcomcast.net>写道:
"Viken Karaguesian" <vi****@NOSPAMcomcast.net> wrote:
有时我想在新窗口中打开超链接(图像等)。


别想了。问题解决了。

过去,我用过target =" _blank"在新窗口中打开链接。
然而,使用目标属性导致我的页面验证失败
(严格的doctype)。验证器说没有属性'目标''。


当然。它很简单,因为2 + 2 = 4.(实际上,更简单;没有算术是

涉及,它是纯语法。)

所以......如何在没有Javscript的情况下在新窗口中打开链接并通过
严格验证?
On occasion I want to open hyperlinks (images, etc.) in a new window.
Stop wanting that. Problem solved.
the past, I''ve used target="_blank" to open the link in a new window.
However, using the "target" attribute causes my pages to fail validation
(strict doctype). The validator says "There is no attribute ''target''.."
Of course. It''s simple as 2 + 2 = 4. (Actually, simpler; no arithmetics is
involved, it''s pure syntax.)
So...how do I open a link in a new window, without Javscript, and pass
strict validation?




你不是。


-

Yucca, http://www.cs.tut.fi/~jkorpela/

有关网页制作的网页: http://www.cs.tut.fi/~jkorpela/www.html



You don''t.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


你现在必须以正确的方式使用javascript。


< a href =" link.html" onclick =" window.open(this.href); return

false;"> link< / a>


这是正确的方法处理它。

You have to use javascript to do it the proper way now.

<a href="link.html" onclick="window.open(this.href);return
false;">link</a>

this is the proper way to handle it.


" Viken Karaguesian" < 6 **** @ NOSPAMcomcast.net>写道:
"Viken Karaguesian" <vi****@NOSPAMcomcast.net> wrote:
有时我想在新窗口中打开超链接(图像等)。
On occasion I want to open hyperlinks (images, etc.) in a new window.




你'我没有指定你使用的是哪种浏览器,一些方法适用于

流行的浏览器:


IE:右击 - >在新窗口中打开

Opera:点击链接鼠标中键(或滚轮)

FF:点击链接鼠标中键(或滚轮)


-

Spartanicus



You''ve not specified what browser you are using, some methods for
popular browsers:

IE: Right click -> Open in new window
Opera: Click link with middle mouse button (or wheel)
FF: Click link with middle mouse button (or wheel)

--
Spartanicus


这篇关于在新窗口中打开链接。什么是“正确的”办法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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