I'm using MVC4 and jQuery, and I need to display a table with two columns; The first column should contain the image of a person and the second, the details of that person.
我正在使用MVC4和jQuery,我需要显示一个包含两列的表;第一列应包含一个人的图像,第二列应包含该人的详细信息。
I'm getting the person's details and the image path from the database via an AJAX call, and display my table. But instead of the image being shown, I am getting path only.
我通过AJAX调用从数据库中获取此人的详细信息和图像路径,并显示我的表格。但是我没有显示图像,而是只获得路径。
How can I get the image using an AJAX call, so I can display it in my table? My controller is returning JSON data.
如何使用AJAX调用获取图像,以便将其显示在表格中?我的控制器正在返回JSON数据。
1 个解决方案
#1
0
You can put image path in tag "src" attribute using javascript.
您可以使用javascript将图像路径放在标记“src”属性中。
#1
0
You can put image path in tag "src" attribute using javascript.
您可以使用javascript将图像路径放在标记“src”属性中。