Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将iframe src设置为本地文件_Iframe_Google Chrome - Fatal编程技术网

如何将iframe src设置为本地文件

如何将iframe src设置为本地文件,iframe,google-chrome,Iframe,Google Chrome,我的HTML中有一个iframe,我想在其中播放本地文件夹中的mpeg/mpg文件,但我无法将视频加载到iframe中。当我设置src=”http://www.google.com,它将显示在iframe中,但如果我尝试src=file:///C:/Documents%20and%20Settings/jgabotero/Desktop/sample.jpg" 它不显示图像 如何将iframe的src属性设置为指向本地文件,特别是存储在IsolatedStorage中的文件 先谢谢你 -- ju

我的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

我认为不能使用file://以iframe格式显示计算机中的文件。这是一个安全问题


我还认为您不能在iframe中显示图像,使用html或ohp页面来实现这一点,因此请将图像放入html文件中,并将iframe链接到此html文件。

我也有完全相同的问题,只是我试图链接到服务器上的文本文件。在IE中查看页面时,它看起来很好,但chrome只是一个白色框。是的,我也这么认为,即使在chrome中调用图像的html或php页面可能会更好,我也可以使用src=“http[…]”在IFrame中显示一个简单的文本文件,但不能使用src=“file[…]”。然而,在IE中,这两种方法都工作得很好(没有测试其他浏览器)。