Firefox中的锚标签问题

时间:2015-08-25 15:12:43

标签: html css html5 firefox anchor

我有一个HTML文件,其中包含带有指向另一个HTML文件的链接的锚标记。 当我点击firefox中的链接时,它没有打开其他HTML文件。请参阅以下HTML代码段:

<html>
<body>
    <table align=left border=1>
        <tr><th>Report Name</th></tr>
        <tr><td><a href="G:\parent directory\Report\Forms Report Summary_2015-08-25 102050.html" target=report_page>Missing Forms Report</a></td></tr>
    </table>
</body>

问题是当点击“href”中的链接并在新的Firefox窗口中打开时,插入了“G”(大写字母),在Firefox中显示“g”(小写字母),我得不到错误页面。我很难理解为什么Firefox将帽子中的“G”作为小写字母“g”。 有人可以帮帮我吗?

但是,当我在Chrome或IE中打开相同的链接时,它会正常开放。

1 个答案:

答案 0 :(得分:2)

锚点的规范期望一个有效的uri,协议为href: 即fileftpmailto或网址片段#

https://developer.mozilla.org/en/docs/Web/HTML/Element/a#attr-href

在您的示例中,它认为您需要file

这应该适用于你的情况:(检查也是为了逃避它,有些浏览器会做一些奇怪的不同事情)

<a href="file:///G:\parent directory\Report\Forms Report Summary_2015-08-25 102050.html" target=report_page>Missing Forms Report</a>