本文介绍了如何从本地目录路径设置img src不形成insode项目文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



i有这样的事情..



imgpath =D:\\ \\ CC_Release\Docuploads \ ScreenShotImages \sample.png;



< img id ='Imgscreenshot'style ='height:284px; margin-top: -460px;宽度:392px; margin-left:402px;'src ='+ imagepath +'/>



i需要在标签中显示此图片。如果我放入项目文件夹,即如果ScreenShotImages文件夹在项目文件夹中,它将正常工作,即



imgpath =.. ScreenShotImages \Sample.img ;



但我的要求是需要工作,即图像应该从本地目录检索并需要在图像标签内显示。



在此先感谢...

解决方案

hello,

i have some thing like this..

imgpath = "D:\CC_Release\Docuploads\ScreenShotImages\sample.png";

<img id= 'Imgscreenshot' style='height:284px;margin-top: -460px;width: 392px;margin-left:402px;' src='" + imagepath + "' />

i need to show this image in the tag. If i put inside the project folder ie, if ScreenShotImages folder is inside project folder it will work fine ie,

imgpath = "..ScreenShotImages\Sample.img";

But my requirement is above need to work, ie, image should retrieve from the local directory and need show inside image tag.

Thanks in advance...

解决方案


这篇关于如何从本地目录路径设置img src不形成insode项目文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 13:33