-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpart3.js
More file actions
27 lines (24 loc) · 932 Bytes
/
part3.js
File metadata and controls
27 lines (24 loc) · 932 Bytes
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
var part3Event = function() {
var query = cb.Query({collectionName: "Weather"});
query.setPage(0,0);
query.fetch(function(err, data){
if (err){
showError("part3", "Either collection does not exist or it doesn't have the right permissions")
}else{
document.getElementById("weatherList").innerHTML = "";
var listElement = document.getElementById("weatherList");
listElement.innerHTML="";
for (var i =0 ; i < data.length; i++) {
node = document.createElement("li");
var textNode = document.createTextNode(JSON.stringify(data[i].data));
node.appendChild(textNode);
listElement.appendChild(node);
}
showView("part3b");
}
});
};
var part3bEvent = function() {
document.getElementById("weatherList").innerHTML = "";
showView("part4");
};