Skip to content

Commit c283c40

Browse files
committed
not_inline.html doesn't work, why not?
1 parent 842a99b commit c283c40

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

not_inline.html

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<style>
6+
table { border-collapse:collapse; margin:8px; background-color:#f8f8f8; }
7+
table td { height:30px; width:100px; border:1px solid blue; padding:3px; }
8+
</style>
9+
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
10+
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
11+
12+
<script>
13+
var movies = [
14+
{ Name: "The Red Violin", ReleaseYear: "1998", Director: "Françs Girard" },
15+
{ Name: "Eyes Wide Shut", ReleaseYear: "1999", Director: "Stanley Kubrick" },
16+
{ Name: "The Inheritance", ReleaseYear: "1976", Director: "Mauro Bolognini" }
17+
];
18+
</script>
19+
20+
21+
<script id="summaryTemplate" src="template.html" type="text/x-jquery-tmpl"></script>
22+
23+
24+
<script>
25+
function renderList() {
26+
$( "#summaryTemplate" ).tmpl( movies ).appendTo( "#moviesList" );
27+
}
28+
</script>
29+
30+
31+
<script>
32+
$(function(){
33+
$('#showBtn').click(function(data){
34+
renderList();
35+
});
36+
});
37+
</script>
38+
39+
</head>
40+
<body>
41+
<button id="showBtn">Show movies</button><br/>
42+
<table><tbody id="moviesList"></tbody></table>
43+
</body>
44+
</html>

template.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script id="summaryTemplate" type="text/x-jquery-tmpl">
2+
<tr> <td>${Name}</td> <td>${ReleaseYear}</td> <td>${Director}</td> </tr>
3+
</script>

0 commit comments

Comments
 (0)