how to set iframe src to local file

泪湿孤枕 提交于 2019-12-23 15:27:18

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/3571007/how-to-set-iframe-src-to-local-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!