(function main() {
handleData();
gtag('config', 'UA-151776166-1');
async function handleData() {
var objs = await xhrServer();
var tags = "
Collection of Fine Cakes
"; L = ""; R = "";
objs.data.forEach(function (S, oddEven) {
tags = tags
+ ' \u25E2 '
+ S.title
+ ' \u25E3
'
R = '
'
+ S.salesPitch
+ '
- Weight: '
+ S.weight
+ " gr
"
+ declaration(S.declaration)
+ '
'
L = '
'
+ '

';
(oddEven % 2 === 0)
? tags = tags + L + R + '
'
: tags = tags + R + L + ''
})
zCakes.innerHTML = tags;
}
function declaration(D) {
var xyz = "";
D.forEach((T) => { xyz = xyz + '' + T + '' })
return xyz;
}
function xhrServer() {
return new Promise(function (serverData, reject) {
var xhr = new XMLHttpRequest();
xhr.open("GET", "seCakes.php", true);
xhr.onreadystatechange = function () { if (xhr.readyState === 4) serverData(JSON.parse(xhr.responseText)) };
xhr.send();
});
}
}
)();