Commit b85d6081 authored by Lu Xu's avatar Lu Xu 👀

WIP

parent fe46ff2a
/*global window, rJS, jIO, RSVP, Blob*/
/*jslint indent:2, maxlen: 80, nomen: true */
(function (window, rJS, jIO, RSVP) {
"use strict";
var gadget_definition = rJS(window);
}(window, rJS, RSVP));
fetch('example.json.log')
.then(function (response) {
return response.json();
})
.then(function (log_list) {
appendData(log_list);
})
.catch(function (err) {
console.log('error: ' + err);
});
function appendData(log_list) {
var mainContainer = document.getElementById("myLog");
for (var i = 0; i < log_list.length; i++) {
var div = document.createElement("div");
console.log(JSON.parse(log_list[i].data))
div.innerHTML = log_list[i].time + " " + log_list[i].log_level + " " + log_list[i].message + " " + log_list[i].data;
mainContainer.appendChild(div);
}
}
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
<head> <head>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="example.json.log"></script> <script src="promise.gadget.js"></script>
<script src="promise_gadget.js"></script>
</head> </head>
<body> <body>
<body> <body>
<div id="myLog"></div> <h1>Couscous</h1>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment