Img labels cannot display images using absolute paths. img absolute paths
Note: The disk path slash of the image is "\", and the network path of the image is.
If this image is a server image or network image, we must use the network path in the Img label. Only the network path can send requests through the browser, download the image to the temporary path of your browser to display it on the page;
If the image is displayed locally, you can directly use the disk path of the image.
The following is an image of a project under my account.The disk path is:
D: \ SourceCode \ MCSFramework \ 02. Develop \ MobileWebApp \ Seagull2 \ WebApi \ Seagull2.YuanXin. WebApi \ Resources \ Pic \ 2016 \ 12 \ .jpg
In the projectThe network path is:
Http: // localhost: 10086/yuanxin/Resources/Pic/2016/12/ ..jpg
:
Cause analysis:
This is because when we enter the disk path in the img tag, we actually sent an http request. This is a failed request and there will be no response information.
Request address: file: // + disk path? Which of the following is a normal request !!!
If the image is originally located locally, the browser can still find the image even if we don't get the response image. However, if the image is originally on another server, you cannot display the image.
For example:
Note: Here is my experience. If you have any mistakes, please criticize and correct them...