ล่าสุดการพัฒนาเว็บบทเรียน
 

AppML HTML รวม


ด้วย AppML คุณสามารถรวม HTML ใน HTML


รวมทั้ง HTML ใน HTML

เป็นตัวอย่างที่ดีในเรื่องนี้คือการรวมส่วนท้าย HTML มาตรฐานในทุกหน้า HTML ของคุณ

นี่คือตัวอย่างของไฟล์ที่มีส่วนท้ายมาตรฐาน:

inc_footer.htm

<hr style="margin-top:10px;">
<p style="font-size:11px">2015&copy; w3ii. All rights reserved.</p>
<hr>

ในตัวอย่างนี้ appml-include-html แอตทริบิวต์ที่ใช้ในการรวมแฟ้ม "inc_footer.htm" :

ตัวอย่าง

<!DOCTYPE html>
<html lang="en-US">

<title>Customers</title>
<link rel="stylesheet" href="style.css">
<script src="http://www.w3ii.com/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>
ลองตัวเอง»