Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I would like to make a link from a web page to a file on a local filesystem and make it work in all browsers (or at least in Internet Explorer, Firefox and Chrome).

For example, the following works in Internet Explorer:

<a href="\myserverdocinfo.pdf">Info here</a>

but not in Firefox and Chrome.

Is there a way to make a link that works in all browsers?

Or a way to use javascript to detect which browser it is and then display the appropriate link based on the filename?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
508 views
Welcome To Ask or Share your Answers For Others

1 Answer

Links to local files on pages that were retrieved via HTTP(S) are deliberately disabled in Mozilla/Firefox, because they can be a security risk, and have been used in attacks in the past.

You can override this behaviour, however. For details, see this article in MozillaZine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...