-
Notifications
You must be signed in to change notification settings - Fork 6
/
sample.html
31 lines (26 loc) · 846 Bytes
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
setInterval(function() {
$.getJSON('/_load_node', {
}, function(data) {
if(data.test_result == 1) {
$("div.value").html(data.test_result);
var newHTML = [];
for (var i = 0; i < data.next_steps.length; i++) {
newHTML.push('<p><button type="submit" name="action" value="' + data.next_steps[i][0] + '" />' + data.next_steps[i][1] + '</button>');
}
$("div.button").html(newHTML.join(""));
}
return false;
});
}, 1000);
</script>
</head>
<body>
<div class="value"></div>
<div class="button"></div>
</body>
</html>