Add menu-inject.js

This commit is contained in:
Antonio Rodrigues 2023-12-08 07:59:06 -03:00
parent 63edefd176
commit 48b5c0426e
1 changed files with 12 additions and 0 deletions

12
menu-inject.js Normal file
View File

@ -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);
});