-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
66 lines (52 loc) · 1.42 KB
/
sample.html
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
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
<title>Druphone</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>
<div data-role="page">
<div id="header" data-role="header">
<h1></h1>
</div><!-- /header -->
<div id="contents" data-role="content">
<ul data-role="listview" data-split-icon="gear" data-split-theme="d" class="ui-listview">
<li id="left"></li>
<li id="right"></li>
<li id="content"></li>
</ul>
</div><!-- /content -->
<div id="footer" data-role="footer"> </div>
</div><!-- /page -->
<script type="text/javascript">
function load_blocks(regions){
$.each(regions, function(i,v){
$.ajax({
type:"POST",
dataType:"json",
data: "r="+i,
url:"/druphone/regions",
success: function( data ) {
$.each(data.data,function(i,v){
$("#"+i).append($.parseJSON(v.blocks));
});
},
});
});
}
$(document).ready(function(){
var regions;
$.ajax({
url:"/druphone/regions/list",
dataType:"json",
success: function(data){
load_blocks(data.data);
}
});
});
</script>
</body>
</html>