username@email.com
2022-01-21 b18a7c8e54b51a5caa400e55cb8cc428c0301a0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <title>Items</title>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript" src="jquery-jtemplates.js"></script>
  <link rel="stylesheet" href="style.css">
 
  <script type="text/javascript">
    $(document).ready(function() {
      $.getJSON('data.json', function(data) {
        var Items = data.Items;
        var Bom = Items[0].BOM; //sample data
        
        $("#ItemBOM").setTemplateElement("Template-BOM");
        $("#ItemBOM").processTemplate(Bom);
      });
    });
  </script>
</head>
 
<body>
  <!-- Templates -->
  <p style="display:none"><textarea id="Template-BOM" rows="0" cols="0"><!--
{*
Main template
*}
{#template MAIN}
  <b>BOM: {$T.Name}</b>
  <div>
  {#include entry root=$T.Elements}
  </div>
{#/template MAIN}
 
{*
Recursed subtemplate
*}
{#template entry}
  <ul>
  {#foreach $T as entry}
    <li>{$T.entry.Qty} {$T.entry.Name}</li>
    {#if $T.entry.Elements}{#include entry root=$T.entry.Elements}{#/if}
  {#/for}
  </ul>
{#/template entry}
  --></textarea></p>
  
  <!-- Output elements -->
  <div id="ItemBOM" class="Content"></div>
  
</body>
</html>