-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
75 lines (57 loc) · 2.49 KB
/
test.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
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<meta charset="utf-8">
<hmtl>
<head>
<script src="plugin/data/jquery-1.4.2.min.js"></script>
</head>
<body>
<script>
function replaceAll(find, replace, str) {
return str.replace(new RegExp(find, 'g'), replace);
}
var respString = '[{"name":"Active","data": {"Investments":"2.56314735","Loans":"37.91682","Debt (estimated)":"27.2760532"}},{"name":"Overdue","data":{"Investments":"0","Loans":"0","Debt (estimated)":"0"}},{"name":"Funding","data":{"Investments":"0.41604277","Loans":"5","Debt (estimated)":"5.025"}}]';
respString = respString.replace(/['()]/g,"");
respString = replaceAll(" estimated","",respString);
var resp = JSON.parse(respString);
$( document ).ready(function() {
var jammerDiv = $("<div>", { class: "span", style: "width:88%;" });
var jammerRow = $("<div>", { class: "row", style: "width:100%;" });
var jammerWidget = $("<div>", { class: "widgetlight"});
var jammerH3 = $("<h3>", { text: "Jammer Data"});
var jammerContent = $("<div>", { class: "widgetcontent"});
jammerDiv.append(jammerRow);
jammerRow.append(jammerWidget);
jammerWidget.append(jammerH3);
jammerWidget.append(jammerContent);
var jammertable = $("<table>", { class: "jammerTable" });
var headers = $("<tr>");
headers.append($("<th>", { text: "" }));
headers.append($("<th>", { text: "Investments" }));
headers.append($("<th>", { text: "Loans" }));
headers.append($("<th>", { text: "Debt" }));
var row2 = $("<tr>");
row2.append($("<td>", { text: "Active" }));
row2.append($("<td>", { class: "invActive", text: resp[0].data.Investments }));
row2.append($("<td>", { class: "loansActive", text: resp[0].data.Loans }));
row2.append($("<td>", { class: "debtActive", text: resp[0].data.Debt }));
var row3 = $("<tr>");
row3.append($("<td>", { text: "Funding" }));
row3.append($("<td>", { class: "invFunding", text: resp[2].data.Investments }));
row3.append($("<td>", { class: "loansFunding", text: resp[2].data.Loans }));
row3.append($("<td>", { class: "debtFunding", text: resp[2].data.Debt }));
var row4 = $("<tr>");
row4.append($("<td>", { text: "Overdue" }));
row4.append($("<td>", { class: "invOverdue", text: resp[1].data.Investments }));
row4.append($("<td>", { class: "loansOverdue", text: resp[1].data.Loans }));
row4.append($("<td>", { class: "debtOverdue", text: resp[1].data.Debt }));
jammertable.append(headers);
jammertable.append(row2);
jammertable.append(row3);
jammertable.append(row4);
jammerContent.append(jammertable);
$('div.jammerDiv').html(jammerDiv);
});
</script>
<div class="jammerDiv"></div>
</body>
</hmtl>