src absolute path problem

后端 未结 4 1945
死守一世寂寞
死守一世寂寞 2020-11-28 10:26

I have an image in C:\\wamp\\www\\site\\img and i try to display it in a page with this:



        
相关标签:
4条回答
  • 2020-11-28 11:05

    You should be referencing it as localhost. Like this:

    <img src="http:\\localhost\site\img\mypicture.jpg"/>

    0 讨论(0)
  • 2020-11-28 11:14

    <img src="file://C:/wamp/www/site/img/mypicture.jpg"/>

    0 讨论(0)
  • 2020-11-28 11:16

    I think because C would be seen the C drive on the client pc, it wont let you. And if it could do this, it would be a big security hole.

    0 讨论(0)
  • 2020-11-28 11:16

    Use forward slashes. See explanation here

    0 讨论(0)
提交回复
热议问题