问题描述
这段 Java 代码,
This Java code,
"<a href='file:///" + curBP.get_build_path() + "'>" + curBP.get_build_path() + "</a>"
输出到浏览器.
在页面上,HTML 是:
On the page, the HTML is:
<a href="file:///\path osharedfile">Shared File</a>
但是,它不会打开文件.我尝试了无数其他斜线组合,但都无济于事.在 FireFox 中,它就像一个死链接,不会打开文件.在 IE 中,它可以工作.
However, it does not open the file. I've tried countless other combinations of slashes, but to no avail. In FireFox, it acts like a dead link and does not open the file. In IE, it works.
知道如何让它在 FireFox 中工作吗?谢谢!
Any idea as to how to make it work in FireFox? Thanks!
推荐答案
坏消息:Firefox 关闭了一个安全漏洞:
Bad news: Firefox has closed a security hole:
http://www.techlifeweb.com/firefox/2006/07/how-to-open-file-links-in-firefox-15.html
它需要用户修改本地文件以允许 file://urls.
It requires the user to modify a local file to allow file:// urls.
这篇关于<A>锚链接到本地文件?(<a href='file:///{path}'>DEAD LINK</a> 不在 FireFox 中工作,但在 IE 中工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!