如何将iframe src设置为本地文件 [英] how to set iframe src to local file

查看:353
本文介绍了如何将iframe src设置为本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的HTML中有一个iframe,我想从本地文件夹播放mpeg / mpg文件,但无法将视频加载到iframe中。当我设置src =http://www.google.com时,它显示在iframe中,但是如果我尝试src =file:/// C:/ Documents%20and%20Settings / jgabotero / Desktop / sample .jpg
它不显示图像。



如何设置iframe的src属性指向本地文件,特别是存储在IsolatedStorage?



预先感谢您。

-
julie

解决方案

我认为您无法在iframe中显示使用file://它的安全问题的文件。



我也认为你不能在iframe,html或ohp页面中显示图像,所以要将图像放在html文件中,并将iframe链接到此html文件。 p>

I have an iframe in my HTML, where i would like to play mpeg/mpg files from local folder, but i can't load the video into the iframe. when i set src="http://www.google.com", it is displayed in the iframe, but if i try src="file:///C:/Documents%20and%20Settings/jgabotero/Desktop/sample.jpg" it doesn't display the image.

How can i set the src property of iframe to point to local files, specially the ones stored in IsolatedStorage?

Thank you in advance.

-- julie

解决方案

i think you can't display files in iframe form your computer using file:// its a security issue.

I also think you can't display images in iframe, ue an html or ohp page, to do this, so put the image in a html file, and link the iframe to this html file.

这篇关于如何将iframe src设置为本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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