update to use single html with dynamic div
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<h2>Restaurant Overview</h2>
|
||||
<div id="restaurant-list">
|
||||
</div>
|
||||
<script>
|
||||
// This script might be moved to the main index.html or a separate JS file
|
||||
function loadRestaurantOverview() {
|
||||
const restaurantListDiv = document.getElementById('restaurant-list');
|
||||
fetch('php/get_restaurant_overview.php')
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
restaurantListDiv.innerHTML = data;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error loading restaurant overview:', error);
|
||||
restaurantListDiv.innerHTML = '<p class="error">Failed to load restaurant overview.</p>';
|
||||
});
|
||||
}
|
||||
|
||||
// Call this function when overview.html is loaded
|
||||
loadRestaurantOverview();
|
||||
</script>
|
||||
Reference in New Issue
Block a user