一个连接 加个什么语句 能让它在新窗口中打开?

来源:百度知道 编辑:UC知道 时间:2024/05/21 19:27:27
就是在制作 网站导航栏时 想让那个页面在新窗口中打开
请问 语句是什么?

target="_blank"

不过 XHTML 1.0s 不支持 target 标签 ...

只能用 JavaScript 模拟 ... 代码如下 ...

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

要新窗口打开的链接 ...

<a href="document.html" rel="external">新窗口</a>

在HTML里面添加 target="new"

target=_blank

如:
<A style="TEXT-DECORATION: none" href="http://www.wducom.com/xdf369/4.htm" target=_blank>

<a href="