Это мой jQuery код:
<script type="text/javascript">
$(document).ready(function () {
$.ajax
({
type: 'POST',
url: '@Url.Action("GetProList")',
dataType: 'json',
data: {},
success: function (data) {
var items = '';
$.each(data, function (i, item) {
console.log(data);
var imgpath = '../../ProductImage/';
var img = imgpath + item.IMAGE;
var price = parseFloat(item.ProductnewPrice);
console.log(img);
var databind = "<div class='col-6 col-md-4 tt-col-item'>" +
"<div class='tt-product thumbprod-center'>" +
"<div class='tt-image-box'>" +
"<a href='#'>" +
"<span class='tt-img'><img src='" + img + "' data-src='" + img + "' /></span>" +
"<span class='tt-img-roll-over'> <img src='" + img + "' data-src='" + img + "' /></span>" +
"</a>" +
"</div>" +
"<div class='tt-description'>" +
"<div class='tt-row'>" +
"<ul class='tt-add-info'>" +
"<li><a href='#'></a></li>" +
"</ul>" +
"</div>" +
"<h2 class='tt-title'><a href='#'>" + item.PRODUCTNAME + "</a></h2>" +
"<div class='tt-price'>" + price / - +"</div> <div class='tt-product-inside-hover'>" +
"<div class='tt-row-btn'><a href='#' class='tt-btn-addtocart thumbprod-button-bg'>ADD TO CART</a>" +
"</div></div></div></div></div>";
$('#listing').append(databind);
});
},
error: function (ex) {
var r = jQuery.parseJSON(response.responseText);
alert("Message: " + r.Message);
}
});
return false;
});
</script>
Это моя консоль. Вывод