Revision 7e24fe8472b4 () - Diff

Link to this snippet: https://friendpaste.com/3gzXIEsH91RYQ7M2fDRBSL
Embed:
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
54
55
56
57
58
59
60
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:pure="http://beebole.com/pure">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Pure Render Engine Example by Just Talk About Web</title>
<link href="css/white.css" rel="stylesheet" type="text/css" title="white" />
<script type="text/javascript" src="js/jqueryMin.js"></script>
<script type="text/javascript" src="http://beebole.com/pure/gitHubWiki/js/pure.js?javascriptly"></script>
<script type="text/javascript">
var directive = {
'tbody tr[class]+' : (function(context, items, pos) { return ( pos % 2 == 1 ) ? 'even' : 'odd'; })};

function render(){
$.getJSON('json.php', 'lang=' + $('#langList').val(), function(books){
$('#target').autoRender(books, directive, $('#templ')[0]);
});
}
$(document).ready(function(){
render();
$('#langList').change(render);
});
</script>
</head>
<body>
<div class="demo">
<div class="htmlDoc">
Programming Language:
<select id="langList">
<option value="java">Java</option>
<option value="php">PHP</option>
<option value="python">Python</option>
</select>
<div style="display:none">
<table class="books" id="templ">
<thead>
<tr>
<th class="title">Title</th>
<th class="publisher">Publisher</th>
<th class="price">Price</th>
</tr>
</thead>
<tbody>
<tr class="list">
<td class="title"> </td>
<td class="publisher"> </td>
<td class="price"> </td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="transformation">
<hr size="1" color="#cccccc" />
Recommended Reading:
<div id="target"></div>
</div>
</div>
</body>
</html>