<A>nchor Link to Local File? (<a href='file:///{path}'>DEAD LINK</a> not working in FireFox but in IE)

浪子不回头ぞ 提交于 2019-12-17 16:58:25

问题


This Java code,

"<a href='file:///" + curBP.get_build_path() + "'>" + curBP.get_build_path() + "</a>"

is outputted to the browser.

On the page, the HTML is:

<a href="file:///\\path\to\shared\file">Shared File</a>

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.

Any idea as to how to make it work in FireFox? Thanks!


回答1:


Bad news: Firefox has closed a security hole:

http://www.techlifeweb.com/firefox/2006/07/how-to-open-file-links-in-firefox-15.html

It requires the user to modify a local file to allow file:// urls.




回答2:


When you use backslashes {} , you're calling Windows Explorer. And IE is integrated with Windows Explorer, FF not integrated



来源:https://stackoverflow.com/questions/4763863/anchor-link-to-local-file-a-href-file-pathdead-link-a-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!