type="module"
(подобное я пробовал и не помогло) указывать в теге fetch('/events/api/get', { method: 'POST', body: sq[0] })
.then(response => response[index].json())
.then((data) => {
console.log(data);
data.forEach((response, index) => {
content[0] = response[index].location !== '' ? '<span data-type="location">' + response[index].location + '</span>' : '';
readyDescription[0] = response[index].content.matchAll(/<p[^>]*>(([^>]|.)*?)<\/p>/ug);
content[0] += '<span data-type="description">' + readyDescription[0][1][0].length > 234 ? mb_strimwidth(readyDescription[0][1][0], 0, 234, '...') : readyDescription[0][1][0] + '</span>';
dateFormat[0] = [
moment(response[index].date_from, 'd/m/Y'),
moment(response[index].date_to, 'd/m/Y')
];
eventCard[0] = '<span id="date">' + response[index].date_to ? dateFormat[0].join(' - ') : dateFormat[0][0] + '</span><img src="' + response[index].titleImage + '" alt="' + response[index].title + '" />';
eventCard[0] += '<span id="title">' + response[index].title + '</span><p>' + content[0] + '</p><a href="/events/' + response[index].id + '">Show more</a>';
responseHtml[0] += '<li>' + eventCard[0] + '</li>';
});
$('#events-body > .events-feed main .slider').html(responseHtml[0]);
$('.load-screen-services').addClass('list-smart-close');
})
.catch(() => { $('.load-screen-services').addClass('list-smart-close'); });
data.forEach((link) => {
link.map((response) => {
content = response.location !== '' ? '<span data-type="location">' + response.location + '</span>' : '';
readyDescription = response.content.matchAll(/<p[^>]*>(([^>]|.)*?)<\/p>/ug);
content += '<span data-type="description">' + readyDescription[1][0].length > 234 ? mb_strimwidth(readyDescription[1][0], 0, 234, '...') : readyDescription[1][0] + '</span>';
dateFormat = [
moment(response.date_from, 'd/m/Y'),
moment(response.date_to, 'd/m/Y')
];
eventCard = '<span id="date">' + response.date_to ? dateFormat.join(' - ') : dateFormat[0] + '</span><img src="' + response.titleImage + '" alt="' + response.title + '" />';
eventCard += '<span id="title">' + response.title + '</span><p>{content}</p><a href="/events/' + response.id + '">Show more</a>';
$('.slider').append('<li>' + eventCard + '</li>');
});
});
matchAll()
?SELECT JSON_UNQUOTE(JSON_EXTRACT(meta, "$.seoData.faqService")) as "question", JSON_UNQUOTE(JSON_EXTRACT(meta, "$.seoData.faqService")) as "answer" FROM serviceList WHERE id='1'
Сам проблемный пример кода на JQuery:
Что здесь не так и как исправить, чтобы файлы со скриптами правильно читались?