主页面,qiantao.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
height: 100px;
width: 100%;
background-color: #ccc;
}
</style>
</head>
<body>
<a href="javascript:;" id="idManual">手册结构</a>
<div id="header">
<iframe id="content" style="display: block;width:100%;border:none;height:1200px;" ></iframe>
</div>
<script src="../../src/js/jquery-3.6.0.min.js"></script>
<script type="text/javascript">
$(function(){
//头部
$("#idManual").click(function(){
$("#content").attr("src","../example/header.html");
})
})
</script>
</body>
</html>
子页面,header.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>header页面</h1>
</html>
执行结果: