I keep getting this error, but I can not figure it out what the problem seems to be. Apparently the error is in the line of currentProduct.find()
var $productTemplate = $(".product-item");
$.ajax({
url: 'data/applicationLayer.php',
type: 'POST',
dataType: 'json',
contentType: "application/x-www-form-urlencoded",
data: {
action: "MOSTRARIMAGENES",
},
})
.done(function(jsonResponse) {
$.each(jsonResponse, function(index, val) {
if (jsonResponse.length) {
$("#initialProductMessage").remove();
var $currentProduct = $productTemplate.clone(true);
$currentProduct.find('.producto1').html(val.nombre + "<br>" + "<img src="val.foto" width="200" height="400">");
$currentProduct.show();
$("#products-display").prepend($currentProduct);
}
});
})
+to concatenate your string with theval.foto