589
правок
User (обсуждение | вклад) Нет описания правки |
User (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
if (document.readyState !== 'loading') { | if (document.readyState !== 'loading') { | ||
console.log('document is already ready, just execute code here'); | |||
myInitCode(); | myInitCode(); | ||
} else { | } else { | ||
document.addEventListener('DOMContentLoaded', function () { | document.addEventListener('DOMContentLoaded', function () { | ||
console.log('document was not ready, place code here'); | |||
myInitCode(); | myInitCode(); | ||
}); | }); | ||
| Строка 13: | Строка 15: | ||
href: "/wiki/Вики-энциклопедия_университета", | href: "/wiki/Вики-энциклопедия_университета", | ||
title: "Главная", | title: "Главная", | ||
text: "Главная", | |||
}, { | }, { | ||
href: "/wiki/Правила", | href: "/wiki/Правила", | ||
title: "Правила", | title: "Правила", | ||
text: "Правила", | |||
}, { | }, { | ||
href: "/wiki/Служебная:Все_страницы", | href: "/wiki/Служебная:Все_страницы", | ||
title: "Все страницы", | title: "Все страницы", | ||
text: "Статьи", | |||
}, { | }, { | ||
href: "/wiki/Служебная:Свежие_правки", | href: "/wiki/Служебная:Свежие_правки", | ||
title: "Свежие правки", | title: "Свежие правки", | ||
text: "История правок", | |||
}, { | }, { | ||
href: "/wiki/Инструкции", | href: "/wiki/Инструкции", | ||
title: "Инструкции", | title: "Инструкции", | ||
text: "Инструкции", | |||
}, { | }, { | ||
href: "/wiki/Контакты", | href: "/wiki/Контакты", | ||
title: "Заголовок 2", | title: "Заголовок 2", | ||
text: "Контакты", | |||
}]; | }]; | ||
items.forEach(function (item) { | items.forEach(function (item) { | ||
| Строка 40: | Строка 42: | ||
a.href = item.href; | a.href = item.href; | ||
a.title = item.title; | a.title = item.title; | ||
a.textContent = item.text; | |||
li.appendChild(a); | li.appendChild(a); | ||
content.appendChild(li); | content.appendChild(li); | ||