javascript - IFrame does not work for local sources? HTML - Stack Overflow

Does IFrame works for local directory? I'm trying to embed excel into my HTML but nothing shows up

Does IFrame works for local directory? I'm trying to embed excel into my HTML but nothing shows up. I have tried many ways to put in my local directory but it remains the same.

<iframe src="file://C:\Documents and Settings\username\Desktop\hi.xls" width="98" height="120" frameborder="0" scrolling="no"></iframe>

The end result have been an empty box.

Does IFrame works for local directory? I'm trying to embed excel into my HTML but nothing shows up. I have tried many ways to put in my local directory but it remains the same.

<iframe src="file://C:\Documents and Settings\username\Desktop\hi.xls" width="98" height="120" frameborder="0" scrolling="no"></iframe>

The end result have been an empty box.

Share Improve this question edited Sep 3, 2015 at 2:08 Mogsdad 45.8k21 gold badges163 silver badges286 bronze badges asked Dec 26, 2014 at 7:03 De De De DeDe De De De 4263 gold badges11 silver badges31 bronze badges 5
  • Don't use local path when you create any web application.. – Anant Dabhi Commented Dec 26, 2014 at 7:05
  • @AnantDabhi Just trying to test it out whether it works. – De De De De Commented Dec 26, 2014 at 7:06
  • better place your file in the same folder and just give the path from that folder........... suppose like........................ <iframe src="files/hi.xls">... It would be better than giving all the path from C:\Documents and Settings........................ – annam priyatam Commented Dec 26, 2014 at 7:08
  • @annampriyatam I have to use the full directory because of the development at the later stage. Using ColdFusion, I'm actually storing the excel files in GetTempDirectory(), a coldfusion function which returns the full directory path. – De De De De Commented Dec 26, 2014 at 7:14
  • oh okk.. then i think may be due to the slashes.. Here you have // in file:// and in the rest of the path you have \.. am not sure that it'll work.. but just give a try... – annam priyatam Commented Dec 26, 2014 at 7:18
Add a ment  | 

1 Answer 1

Reset to default 3

you can't add I-frame with local file src All modern browsers prevent display of "local" files using the file protocol in iframes for security reasons.

check your browser console... if you get message like it means your browser prevent load local resource to Iframe

Not allowed to load local resource

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745118131a4612254.html

相关推荐

  • javascript - IFrame does not work for local sources? HTML - Stack Overflow

    Does IFrame works for local directory? I'm trying to embed excel into my HTML but nothing shows up

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信