HTML AppML Bao gồm
Với AppML, bạn có thể đưa HTML vào HTML.
Bao gồm HTML trong HTML
Một ví dụ điển hình về điều này là đưa chân trang HTML tiêu chuẩn vào tất cả các trang HTML của bạn.
Đây là ví dụ về tệp chứa chân trang tiêu chuẩn:
inc_footer.htm
<hr style="margin-top:10px;">
<p style="font-size:11px">2016© W3Schools. All rights reserved.</p>
<hr>
Trong ví dụ này, thuộc tính appml-include-html được sử dụng để bao gồm tệp "inc_footer.htm":
Ví dụ
<!DOCTYPE html>
<html lang="en-US">
<title>Customers</title>
<link rel="stylesheet" href="style.css">
<script src="https://www.example.com.vn/appml/2.0.3/appml.js"></script>
<body>
<h1>Customers</h1>
<table appml-data="customers.js">
<tr>
<th>Customer</th>
<th>City</th>
<th>Country</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>
Hãy tự mình thử »