Witam
Prośba o pomoc, co robię nie tak, że funkcja zwraca mi UNDEFINIED
document.addEventListener('DOMContentLoaded', (event) => {
const equipmentHelmet = document.querySelectorAll('.equipment_helmet');
function all() {
$.ajax({
type: "GET",
url: './form/eq_helmet.php',
success: function (response) {
response = JSON.parse(response);
if(response.length) {
console.log(response);
return {
buttons: {
Spam: ({
text: ' ',
backgroundColor: 'transparent',
buttonWithImage: true,
imageFrame: 'url(/images/equipment/EQ_Common.webp)',
imageOptURL: 'url(/images/equipment/ACCESSORY_Ambrosial_Cup.webp)',
imageOptSize: 'cover',
imageOptPosition: 'center',
imageOptRepeat: 'no-repeat',
imageWidth: '80px',
imageHeight: '80px',
action: function(){
}
})
}
}
}
}
});
}
equipmentHelmet.forEach(div => {
div.addEventListener('click', function() {
$.confirm({
content: '',
title: 'Zmień Budynek',
closeIcon: true,
action: console.log(all()),
});
});
});
});
Ten post edytował topcio 20.04.2023, 05:20:21