// SCRIPT ÉQUIPE - CHARGEMENT DYNAMIQUE DE team.html (function() { 'use strict'; var path = window.location.pathname; var isTeamRoute = path === '/team' || path === '/team/' || path.startsWith('/team/'); if (!isTeamRoute) { return; } console.log('🔄 ÉQUIPE: Chargement du contenu _team-content'); // Charger le contenu via fetch (fichier sans extension pour éviter redirection reverse proxy) function loadTeamContent() { fetch('/_team-content') .then(function(response) { if (!response.ok) throw new Error('HTTP ' + response.status); return response.text(); }) .then(function(html) { console.log('✅ ÉQUIPE: Contenu team.html chargé'); // Remplacer tout le document document.open(); document.write(html); document.close(); }) .catch(function(error) { console.error('❌ ÉQUIPE: Erreur chargement:', error); }); } // Charger immédiatement if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', loadTeamContent); } else { loadTeamContent(); } })();