dataType: "json",
, а при выводе из php echo json_encode($vibranye);
const days = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье'];
// или
const days = Array.from({ length: 7 }, (_, i) => new Date(1, 0, i)
.toLocaleString('ru', { weekday: 'long' })
.replace(/./, m => m.toUpperCase()
));
for (
let iDay = 0;
confirm(`${days[iDay]}. Хотите увидеть следующий день?`);
iDay = (iDay + 1) % days.length
) ;
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", makeOk);
} else {
makeOk();
}
function makeOk() {
setTimeout(
function() {
let elementList = Array.from(document.getElementsByClassName('desc'));
elementList .forEach(element => {
element.attributes.style = "";
});
let elementList2 = Array.from(document.querySelectorAll('div.answer-row > div'));
elementList2 .forEach(element => {
element.className = "";
});
}, 500);
}
Built-in classes such as Date, Array, DOM etc cannot be properly subclassed due to limitations in ES5 (for the es2015-classes plugin). You can try to use babel-plugin-transform-builtin-extend based on Object.setPrototypeOf and Reflect.construct, but it also has some limitations.
getElementById()
– только у document. См. методы Element.document.getElementById('irc_cc')