如何制作一个在 IE 和 Firefox 中都可以使用的 file://超链接? [英] How do I make a file:// hyperlink that works in both IE and Firefox?

查看:32
本文介绍了如何制作一个在 IE 和 Firefox 中都可以使用的 file://超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的文档网页中,我经常需要提供指向存储在 Intranet 上的位置、文件和应用程序 (.xbap) 的链接.

In my documentation web pages, I often need to provide links to locations, files and applications (.xbap) stored on the intranet.

在 IE 中,这适用于格式如下的 URL:

In IE, this works fine with URLs formatted like this:

<a href="file://///company.org/ProjectA/StatsReport">Go to folder</a>
<a href="file://///company.org/ProjectA/Readme.txt">Download file</a>
<a href="file://///company.org/ProjectA/Dashboard.xbap">Run xbap</a>

这些链接在 IE 下都可以正常工作,但在 Firefox 中则不行.

These links all work fine under IE, but in Firefox they don't.

有谁知道我如何格式化上述链接以在 IE 和 Firefox 中工作?

Does anyone know how I can format the above links to work both in IE and Firefox?

编辑如果我将它们放在本地文件中,上面的链接实际上可以工作.当它们是网络上的 html 文件的一部分时(不是在我的机器上),它们仅在 Firefox 中停止工作.Firefox 中必须有某种安全设置来防止 file:///链接来自外部内容?

Edit The above link actually work if I put them in a local file. They stop working only in Firefox when they are part of a html file on the network (not on my machine). There must be some kind of security setting in Firefox that prevents file:/// links from working coming from external content?

推荐答案

就用

file:///

据我所知适用于 IE、Firefox 和 Chrome.

works in IE, Firefox and Chrome as far as I can tell.

请参阅 http://msdn.microsoft.com/en-us/library/aa767731(VS.85).aspx 了解更多信息

see http://msdn.microsoft.com/en-us/library/aa767731(VS.85).aspx for more info

这篇关于如何制作一个在 IE 和 Firefox 中都可以使用的 file://超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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