I have a folder with images called " LaptopsImages ".
In my file called laptops.php i have an array list with different laptops with variables like: title, brand, price, description, spec and pictures names. My array list is convert to XML DOM tree.
On my file called product.html i wrote a code that take every product data into the variables and display it:
var title = $theProduct.find('title').text();
var brand = $theProduct.find('brand').text();
var price = $theProduct.find('price').text();
var description = $theProduct.find('description').text();
var spec = $theProduct.find('spec');
var imageFilename = $theProduct.find('picture').text();
document.getElementById("title").innerHTML=title
document.getElementById("brand").innerHTML=brand
document.getElementById("price").innerHTML=price
document.getElementById("description").innerHTML=description
document.getElementById("spec").innerHTML=description
I have accomplished to display every product data into my html except the pictures for each laptop. Is any way that i can display pictures with the name they have already from my variable? Assume that the pictures have names " 0001.jpg , 0002.jpg " and so on.
Every picture can be taken from: var imageFilename=$theProduct.find('picture').text();