当前位置: 代码迷 >> 综合 >> Html如何回显服务器返回的图片地址
  详细解决方案

Html如何回显服务器返回的图片地址

热度:49   发布时间:2023-11-02 12:27:51.0

不废话:

<tr th:each="entries,stat:${proSubitemList}" th:style="'background-color:'+@{${stat.odd}?'#F2F2F2'}">                                         <td th:text="${stat.count}"></td>                                   <td th:text="${entries.projectSubitemId}"></td>                                  <td><img  th:attr="src=${entries.projectSubitemQRCode}"></td><td th:text="${entries.createTime}"></td>
</tr>

其中entries.projectSubitemQRCode是你上传服务器后返回的服务器图片地址!

 

顺便说一下:

Html如何在遍历列表中怎么获取列表的某条数据的操作id

<tr th:each="entries,stat:${messageList}" th:style="'background-color:'+@{${stat.odd}?'#F2F2F2'}"><td th:text="${stat.count}"></td><td th:text="${entries['title']}"></td><td th:text="${entries['createTime']}"></td><td><a th:id="${entries.id}" onclick="deleteMessage(this.id)" style="background-color: blue">删除</a></td>
</tr>

其中    th:id="${entries.id}"   为给a标签赋值id    

之后再onclick中传参this.id   就可以在js里获取到要操作某条记录的id了!

 
 

  相关解决方案