Add menu-inject.js
This commit is contained in:
parent
63edefd176
commit
48b5c0426e
|
@ -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);
|
||||
});
|
Loading…
Reference in New Issue