
HTML에서 다른 HTML을 호출하는 방법을 도입했습니다. 여러 가지 방법을 시도하고 모두 나열했습니다.
첫 번째 방법이 현재 프로젝트에 적합한지 확인하기 위해 다른 방법을 시도해 볼 수 있습니다.
1. p+$(“#page1”).load(“b.html”)참조 코드:
<body>
<p id="page1"></p>
<p id="page2"></p>
<script>
$("#page1").load("page/Page_1.html");
$("#page2").load("page/Page_2.html"); </script></body> 2. iframe 참조 코드:
<head>
</head>
<body>
<p id="page1">
<iframe align="center" width="100%" height="170" src="page/Page_1.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no">
</iframe>
</p>
<p id="page2">
<iframe align="center" width="100%" height="170" src="page/Page_2.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no">
</iframe>
</p>
</body> 3. 개체 소개 참조 코드:
<head>
<object style="border:0px" type="text/x-scriptlet" data="page/Page_1.html" width=100% height=150>
</object></head>4. 가져오기 소개 참조 코드:
<head>
<link rel="import" href="page/Page_1.html" id="page1"></head><body>
<script>
console.log(page1.import.body.innerHTML); </script></body>참조 기사: https://www.web-tinker.com/article/20637.html
5. easyui의 윈도우 컴포넌트도 이 효과와 다소 비슷합니다.
이 기사는 다음에서 복제되었습니다: https://blog.csdn.net/arvin0/article/details/56839242
추천 튜토리얼: "
HTML Tutorial위 내용은 다른 html 파일을 html에 추가하는 방법을 단계별로 가르쳐주세요(자세한 설명)의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!