AppML HTML 包含項
使用 AppML,您可以在 HTML 中包含 HTML。
在 HTML 中包含 HTML
一個很好的例子是,在所有 HTML 頁面中包含一個標準的 HTML 頁尾。
這是包含標準頁尾的檔案示例
inc_footer.htm
<hr style="margin-top:10px;">
<p style="font-size:11px">2016© W3Schools. 版權所有。</p>
<hr>
在此示例中,appml-include-html 屬性用於包含檔案 "inc_footer.htm"
示例
<!DOCTYPE html>
<html lang="en-US">
<title>客戶</title>
<link rel="stylesheet" href="style.css">
<script src="https://w3schools.tw/appml/2.0.3/appml.js"></script>
<body>
<h1>客戶</h1>
<table appml-data="customers.js">
<tr>
<th>客戶</th>
<th>城市</th>
<th>國家</th>
</tr>
<tr appml-repeat="records">
<td>{{CustomerName}}</td>
<td>{{City}}</td>
<td>{{Country}}</td>
</tr>
</table>
<div appml-include-html="inc_footer.htm"></div>
</body>
</html>
自己試試 »