Show image base64 string in a row
Show image base64 string in a row
Molax
Posts: 3Questions: 2Answers: 0
Hi, I want to build a DataTable that shows a image on the frist row, but I receive an object from the ajax like this
Object
FK_SIZE: 4
FK_TYPE: 2
NAME: "Skol Lata"
PHOTO: (Base64 string too long to put in here)
When I put the Data on the DataTable like this code
$('#drinkTable').DataTable({
data: data,
columns: [
{ data: 'PHOTO' },
{ data: 'NAME' },
{ data: 'FK_TYPE' },
{ data: 'FK_SIZE' }
]
});
the table shows the base64 string -> http://prntscr.com/92x3rp
I would like to show the image that the string represents
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Theres no JS library or jQuery function that can render an image from the Base64 encoded string... that needs to be done on the server side. Definitely not something handled by DataTables..
Thank you ! I put this code on back-end
```
```
then the data went to the front exaclty how i wanted, now it works fine, thanks for the tip.