function creategalleryBoxViewBody(link) {
closegalleryBox() ;
var container = document.createElement('div') ;
getproddata(parseInt(link.dataset.prodid)).then(function(data){
alert (data);
});
container.innerHTML = '<div id="galleryBox_view" class="galleryBox"> \
<div class="galleryBox_content"> \
<span id="close_galleryBox" onclick="closegalleryBox()">×</span> \
<img src="' + link.src + '" alt="Картинка"> \
</div> \
</div>' ;
document.body.appendChild(container.firstChild) ;
}
function getproddata(prod_id) {
return fetch('getproduct/'+prod_id)
.then(status)
.then(json)
.then(function(data) {
console.log('Request succeeded with JSON response', data);
alert ("Input" + data)
return (data) ;
}).catch(function(error) {
console.log('Request failed', error);
});
}