You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="zh-CN">
|
|
|
|
|
<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>主页面</title>
|
|
|
|
|
<link rel="stylesheet" href="./css/app.css">
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="menu">
|
|
|
|
|
<!-- 从html文件加载 -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="context">
|
|
|
|
|
<span>经比较,使用js或jQuery库最方便!</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 使用原生js加载html文件 注意fetch的兼容性-->
|
|
|
|
|
<script>
|
|
|
|
|
fetch("./Import.html")
|
|
|
|
|
.then(response=> response.text())
|
|
|
|
|
.then(text=> document.getElementsByClassName("menu")[0].innerHTML = text);
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|