In this function I have in input an array of images(link of the img on google) and I want to show the image in my HTML code, in var fullLink I have the link to HTML page. Any suggestions?
My JS function:
function showImageContributors(data) {
var url = "chrome-extension://paiocjmlmleigfefjijbaglphlbgfcdo/src/browser_action/contribuenti.html";
var nameRepo = window.location.hash;
var fullLink = url+nameRepo;
document.getElementById("imageCollaborators").appendChild(() => data.map((image) => <img src='${data}' />));
}
My HTML where the images have to be shown:
<div class="col-lg-4 ms-auto">
<div id="imageCollaborators" class="imageCollaborators"><img id="image" src="" class="image" /></div>
</div>
You can do something like
function showImageContributors(contributors) {
var data = [];
var link = "chrome-extension://paiocjmlmleigfefjijbaglphlbgfcdo/src/browser_action/contribuenti.html/";
contributors.forEach(c => {
data.push(c.image);
$.getJSON(link + $.param(data), function(res) {});
});
pimage.remove();
document.getElementById("imageCollaborators").appendChild(() => contributors.map((contributor) => <img src=`${contributor.image}` />);
}