我在“C:/images/”上几乎没有 jpeg 图片。我想在网页上幻灯片放映这些图像。我正在使用 java 代码获取图像文件夹的正确路径,并使用 jsp 作为具有 html div 元素的前端来显示图像。我试过这样显示单张图片但失败了,谁能帮帮我
<div id="image" style="background-color:yellow; height:200px; width:100px;float:left;">
<img src="C:/Desktop/Images/Image1.jpg" style="height:200px; width:100px;floatleft;">
最佳答案
这篇文章中的相同问题: Why can't I do <img src="C:/localfile.jpg">?
但您可以使用“../”来定位正确的路径。 http://www.pagetutor.com/html_tutor/missing.html
但是为什么你不想在你的应用程序上创建一个文件夹。它比在桌面等设备上访问它更容易。
关于javascript - 如何从本地文件夹中获取图像以显示在 div 元素 html 上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19652602/