From 48b5c0426eb724fe56be137d072562d560c810b2 Mon Sep 17 00:00:00 2001 From: Antonio Rodrigues Date: Fri, 8 Dec 2023 07:59:06 -0300 Subject: [PATCH] Add menu-inject.js --- menu-inject.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 menu-inject.js diff --git a/menu-inject.js b/menu-inject.js new file mode 100644 index 0000000..ed5f1dc --- /dev/null +++ b/menu-inject.js @@ -0,0 +1,12 @@ +// Assuming you have an element with the ID "menu" where you want to inject the menu +const menuElement = document.getElementById('menu'); + +// Fetch the menu content from menu.html +fetch('menu.html') + .then(response => response.text()) + .then(data => { + menuElement.innerHTML = data; + }) + .catch(error => { + console.error('Error fetching menu:', error); + });