JQuery-вызов ajax в tpl имеет блокировку Cross-Origin Read Blocking (CORB), заблокированную в ответе Cross-Origin?Я использовал jsonp dataType и добавил модуль drupa CORS, но это предупреждение появляется в консоли.
$('#video .video_front__block').each(function(index) {
$.ajax({
url: $(this).text(),
type: 'get',
dataType: 'jsonp',
error: function() {},
success: function(data) {
$('.video_front').hide();
$('.loader').show();
// data = JSON.parse(data);
if (index == 0) {
$('.video_front__big--item').eq(index).html(
'<a class="video_front__big--item" href="' + $('#video .video_front__block').eq(index).attr('data-url') + '" >' +
'<img class="img-fluid video_front__big--img" src="' + data.video.big_poster + '"/>' +
'<div class="img-fluid video_front__big--title mt-1011 mb-2">' + data.video.title + '</div>' +
'</a>'
);
} else {
$('#video .video_front__block').eq(index).html(
'<a class="video_front__block__item justify-content-center align-content-center align-items-center align-content-center mb-1" href="' + $('#video .video_front__block').eq(index).attr('data-url') + '" >' +
'<img class="video_front__block__item--img img-fluid" src="' + data.video.small_poster + '"/>' +
'<div class="video_front__block__item--title col-sm-12 col-md-8 align-self-center pr-0 pl-0 pr-md-2 pb-2 ">' + data.video.title + '</div>' +
'</a>'
);
$('#video .video_front__block').eq(0).css('display', 'none');
}
$('.loader').hide();
$('.video_front').show();
}
});
});