【发布时间】:2022-11-16 15:53:56
【问题描述】:
我有从服务器返回的图像吗?
路径是 https:\localhost:7229\Images\sample-clouds-400x300.jpg
当我把它放在 src 中时,它进入网络
https:\localhost:7229\https:\localhost:7229\Images\sample-clouds-400x300.jpg
任何原因 ?
【问题讨论】:
标签: html
我有从服务器返回的图像吗?
路径是 https:\localhost:7229\Images\sample-clouds-400x300.jpg
当我把它放在 src 中时,它进入网络
https:\localhost:7229\https:\localhost:7229\Images\sample-clouds-400x300.jpg
任何原因 ?
【问题讨论】:
标签: html
这来自您的错字:
https:localhost:7229Imagessample-clouds-400x300.jpg
î There should be 2
由于只使用了一个斜杠,路径被视为相对路径,然后浏览器通过添加当前页面的 url 将其转换为绝对路径。
【讨论】:
你能提供一些代码吗?您调用什么来检索路径以及如何将路径插入页面?
【讨论】: