From 2bfc710d78df0b217cbc8e9d25af1f10b5d7cbd5 Mon Sep 17 00:00:00 2001 From: zmorok Date: Thu, 2 May 2024 10:19:01 +0300 Subject: [PATCH] footerIndex --- index.html | 2 +- src/footerIndex.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/footerIndex.js diff --git a/index.html b/index.html index 6f05434..3440ccf 100644 --- a/index.html +++ b/index.html @@ -128,7 +128,7 @@

Каталог

- + diff --git a/src/footerIndex.js b/src/footerIndex.js new file mode 100644 index 0000000..877a195 --- /dev/null +++ b/src/footerIndex.js @@ -0,0 +1,16 @@ +document.addEventListener('DOMContentLoaded', function () { + const getData = () => { + const footer = document.querySelector('footer') + const xhttp = new XMLHttpRequest() + xhttp.open('GET', 'footer.xml', true) + xhttp.send() + xhttp.onload = function () { + const xmlData = this.responseXML + const footerXML = xmlData.querySelector('.footer-container') + footer.appendChild(footerXML) + footer.innerHTML += `` + } + } + + getData() +})