标题标签存在问题,当包含在主页中时显示错误。
这是我试图包含的电子商务页面
<body>
<header id="header"> </header>
<footer id="footer"> </footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
$(function(){
$("#header").load('header.html');
$("#footer").load('footer.html');
});
</script>
</body>
它应该看起来像这样。
您需要在根目录中有 header.html 文件并使用网络服务器运行index.html
我为您创建复制代码:https://stackblitz.com/edit/web-platform-ubnol3?file=index.html