Firefox不会在iframe中加载本地文件 [英] Firefox doesn't load local file in iframe
本文介绍了Firefox不会在iframe中加载本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文件
file:///C:/Users/7%20Legged%20Spider/Desktop/test.html
file:///C:/Users/7%20Legged%20Spider/Desktop/test.html
当我将其设置为iframe时
When I set it into an iframe
<iframe src ="file:///C:/Users/7%20Legged%20Spider/Desktop/test.html">
< iframe src="file:///C:/Users/7%20Legged%20Spider/Desktop/test.html">
iframe是空白的,为什么会这样以及如何解决
The iframe is blank, why is this and how can I fix it
推荐答案
这是由于安全问题.您绝对不能绕过它.
It is because of security issue. You can not bypass it by any mean.
由于以下原因,您不应将本地文件用作 href
:
You should not use local file as href
because of:
- 安全问题
- 意外" URL(并非每个人都有C:\)
- 如果仅将其用于开发,则可能需要将文件上传到服务器以包含它.
这篇关于Firefox不会在iframe中加载本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文