Geh zurück
Wann möchten Sie Ihre Bestellung abholen?
Geh zurück
Wählen Sie einen Ort aus der Liste
fetch('https://www.dunkindonuts.nl/foodticket/cgi/bestel-nt.cgi?action=get-pickup-info&client_id=5621')
.then(response => response.json())
.then(data => {
var select = document.querySelector('select'); // eventueel selector aanpassen!
select.innerHTML = '';
var appendTo = select;
data.forEach(element => {
if (element.group_start) {
appendTo = document.createElement("optgroup");
appendTo.label = element.group_start;
}
var option = document.createElement("option");
option.text = element.address+(element.city?', '+element.city:'');
option.value = element.id;
appendTo.appendChild(option);
if (element.group_end) {
select.appendChild(appendTo);
appendTo = select;
}
});
});
Geh zurück
Wählen Sie einen Ort aus der Liste
fetch('https://www.dunkindonuts.nl/foodticket/cgi/bestel-nt.cgi?action=get-pickup-info&client_id=5621')
.then(response => response.json())
.then(data => {
var select = document.querySelector('select'); // eventueel selector aanpassen!
select.innerHTML = '';
var appendTo = select;
data.forEach(element => {
if (element.group_start) {
appendTo = document.createElement("optgroup");
appendTo.label = element.group_start;
}
var option = document.createElement("option");
option.text = element.address+(element.city?', '+element.city:'');
option.value = element.id;
appendTo.appendChild(option);
if (element.group_end) {
select.appendChild(appendTo);
appendTo = select;
}
});
});