How to get x-template from html file
Hi:
I meet a problem about how to get the x-template from html file.
the following is my x-template code snippet
- <script type="text/x-template" id="TableTemplate">
- <thead>
- <tr>
- <th width="250px">Model</th>
- <th width="250px">Name</th>
- <th width="70px">Share</th>
- <th width="150px">Price Range</th>
- <th width="150px">Brand</th>
- <th width="100px">Options</th>
- </tr>
- </thead>
- <tbody>
- <tr propertyName="trModel">
- <td><span propertyName="Model"></span>
- </td>
- <td><span propertyName="Name"></span></td>
- <td>
- <button type="button" propertyName="btnName" onclick="doFunction();">Try</button>
- </td>
- <td><span propertyName="PriceRange"></span></td>
- <td><span propertyName="Brand"></span></td>
- <td><select propertyName="Options"></select></td>
- </tr>
- </tbody>
- </script>
And I store the upper code in a templates.html, and then try following code:
-
- $.get('./templates.html', function(template) {
-
- });
But I didn't know how to do the next step to get the exact DOM element x-template from templates.html.
Is anyone know how to make that, thanks a lot.