sorry for my poor English. So this is my question. I want to display images, theses images are defined in a js file. 3 images in this exemple but they can be more than.
In a js file, i have this code
var med1 = {
title: "Title",
description: "Description",
icon: "file/1.png"
};
var med2 = {
title: "Other Title",
description: "Other description",
icon: "file/imagesecond.png"
};
var med3 = {
title: "The title",
description: "The description",
icon: "file/google.png"
};
And in another page, i call this file and execute
function affiche(a,b,c)
{
var x = document.createElement("IMG");
x.setAttribute("src", a);
x.setAttribute("width", "100");
x.setAttribute("height", "100");
x.setAttribute("alt", b);
x.setAttribute("title", c);
document.body.appendChild(x);
}
for (var i = 1; i <= 3; i++) {
console.log('med'+i);
affiche(med+i.icon,med+i.title,med+i.description)
}
In console, i have med1, med2, med3 but "med" is not defined in function. Can you help me to resolve my problem?