Firefox不会在iframe中加载本地文件 [英] Firefox doesn't load local file in iframe
本文介绍了Firefox不会在iframe中加载本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文件
file:/// C:/Users/7%20Legged%20Spider/Desktop/test.html
当我将它设置为一个iframe时
< iframe src =file:/// C:/Users/7%20Legged%20Spider/Desktop/test.html>
iframe是空白的,为什么是这样的,我怎样才能修复它? 解决方案
这是因为安全问题。你不能绕过它。
你不应该使用本地文件作为 href
,因为:安全问题
意外的URL(不是每个人都有C:\)
I have a file
file:///C:/Users/7%20Legged%20Spider/Desktop/test.html
When I set it into an iframe
< iframe src="file:///C:/Users/7%20Legged%20Spider/Desktop/test.html">
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.
You should not use local file as href
because of:
- Security problems
- "Unexpected" URLs (not everyone has C:\)
- If you are using it only for development, you may want to upload the file to your server in order to include it.
这篇关于Firefox不会在iframe中加载本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文